Comparing version 3.0.1 to 3.0.2
@@ -21,3 +21,3 @@ { | ||
], | ||
"version": "3.0.1", | ||
"version": "3.0.2", | ||
"repository": { | ||
@@ -24,0 +24,0 @@ "type": "git", |
@@ -17,2 +17,3 @@ Minifyify | ||
### Programmatic API | ||
```js | ||
@@ -24,3 +25,3 @@ var browserify = require('browserify') | ||
bundler.plugin('minifyify', options); | ||
bundler.plugin('minifyify', {map: 'bundle.map.json'}); | ||
@@ -32,6 +33,11 @@ bundler.bundle(function (err, src, map) { | ||
The map option should be the location of the sourcemap on your server, and is used to insert the `sourceMappingURL` comment in `src`. | ||
### Command Line | ||
```sh | ||
browserify entry.js -p [minifyify --output bundle.map.json] > bundle.json | ||
$ browserify entry.js -p [minifyify --map bundle.map.json --output bundle.map.json] > bundle.js | ||
``` | ||
The `--output` option is a required option unique to the command line interface and specifies where minifyify should write the sourcemap to on disk. | ||
## Options | ||
@@ -38,0 +44,0 @@ |
@@ -14,8 +14,9 @@ /* globals jake */ | ||
var appname = 'simple file' | ||
, mapFile = 'bundle.clied.map.json' | ||
, browserify = path.join(path.dirname(require.resolve('browserify')), 'bin', 'cmd.js') | ||
, minifyify = path.join(__dirname, '..', 'lib', 'index.js') | ||
, outFile = path.join(fixtures.buildDir, 'apps', appname, 'bundle.clied.js') | ||
, outMapFile = path.join(fixtures.buildDir, 'apps', appname, 'bundle.clied.map.json') | ||
, outMapFile = path.join(fixtures.buildDir, 'apps', appname, mapFile) | ||
, cmd = browserify + ' "' + jsesc(fixtures.entryScript(appname), {quotes: 'double'}) + | ||
'" -p [ "' + jsesc(minifyify, {quotes: 'double'}) + '" --output "' + jsesc(outMapFile, {quotes: 'double'}) + '" ] > "' + | ||
'" -p [ "' + jsesc(minifyify, {quotes: 'double'}) + '" --map ' + mapFile + ' --output "' + jsesc(outMapFile, {quotes: 'double'}) + '" ] > "' + | ||
jsesc(outFile, {quotes: 'double'}) + '"' | ||
@@ -42,3 +43,5 @@ , ex = jake.createExec(cmd) | ||
assert.doesNotThrow(function () { | ||
validate(fs.readFileSync(outFile).toString(), fs.readFileSync(outMapFile).toString()) | ||
var src = fs.readFileSync(outFile).toString(); | ||
validate(src, fs.readFileSync(outMapFile).toString()); | ||
assert.ok(src.indexOf(mapFile) >= 0, 'The map argument should have been used'); | ||
}, 'The bundle should have a valid external sourcemap'); | ||
@@ -45,0 +48,0 @@ next(); |
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
635378
15880
115