async-define
Advanced tools
Comparing version 3.1.0 to 3.2.0
@@ -16,2 +16,3 @@ #! /usr/bin/env node | ||
var scriptPath = argv.script || argv.s; | ||
var hasSourceMaps = argv.sourcemaps; | ||
@@ -34,4 +35,6 @@ exportVar = exportVar ? exportVar.split(',') : []; | ||
script: script, | ||
scriptName: scriptName | ||
scriptName: scriptName, | ||
hasSourceMaps: typeof hasSourceMaps !== 'undefined', | ||
})); | ||
process.exit(); | ||
@@ -38,0 +41,0 @@ |
{ | ||
"name": "async-define", | ||
"version": "3.1.0", | ||
"version": "3.2.0", | ||
"description": "Coordinate the execution of asynchronous scripts", | ||
@@ -39,4 +39,5 @@ "main": "lib/asyncDefine.js", | ||
"handlebars": "^4.0.5", | ||
"magic-string": "^0.22.4", | ||
"minimist": "^1.2.0" | ||
} | ||
} |
@@ -172,2 +172,3 @@ asyncDefine | ||
* -script (-s): the path of the script to wrap into asyncDefine | ||
* -sourcemaps: produce sourcemaps | ||
Example: | ||
@@ -174,0 +175,0 @@ ``` |
@@ -27,2 +27,3 @@ var fs = require('fs'); | ||
var scriptName = opts.scriptName; | ||
var hasSourceMaps = opts.hasSourceMaps; | ||
@@ -51,8 +52,12 @@ var mainTemplate = '../templates/main.hbs'; | ||
var map = s.generateMap({ | ||
source: scriptName, | ||
file: scriptName + '.map', | ||
includeContent: true | ||
}); // generates a v3 sourcemap | ||
return s.toString() + '\n//# sourceMappingURL=' + map.toUrl(); | ||
var output = s.toString(); | ||
if (hasSourceMaps) { | ||
var map = s.generateMap({ | ||
source: scriptName, | ||
file: scriptName + '.map', | ||
includeContent: true | ||
}); // generates a v3 sourcemap | ||
output += '\n//# sourceMappingURL=' + map.toUrl(); | ||
} | ||
return output; | ||
} | ||
@@ -59,0 +64,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
204
19865
3
14
258
+ Addedmagic-string@^0.22.4
+ Addedmagic-string@0.22.5(transitive)
+ Addedvlq@0.2.3(transitive)