Comparing version 0.2.0 to 0.2.1
@@ -14,3 +14,3 @@ { | ||
], | ||
"version": "0.2.0", | ||
"version": "0.2.1", | ||
"repository": { | ||
@@ -33,2 +33,5 @@ "type": "git", | ||
, "jake": "latest" | ||
, "jquery-browserify": "1.8.x" | ||
, "ribcage-view": "0.0.x" | ||
, "hbsfy": "0.1.x" | ||
}, | ||
@@ -35,0 +38,0 @@ "optionalDependencies": {}, |
@@ -7,4 +7,9 @@ Minifyify | ||
Minifyify minifies your bundle and pulls the source map out into a separate file. Now you can **deploy a minified bundle in production, and still have a sourcemap handy for when things inevitably break**. | ||
Minifyify minifies your bundle and pulls the source map out into a separate file. Now you can deploy a minified bundle in production, and still have a sourcemap handy for when things inevitably break! | ||
## Known Issues | ||
* Help! Source maps for backbone apps are broken. See [issue #1](https://github.com/ben-ng/minifyify/issues/1) for more info. | ||
* Tests aren't complete yet while I focus on fixing [#1](https://github.com/ben-ng/minifyify/issues/1) | ||
## Usage | ||
@@ -15,3 +20,14 @@ | ||
, minifyify = require('minifyify') | ||
, bundle = new browserify(); | ||
, path = require('path') | ||
, bundle = new browserify() | ||
, opts = { | ||
// The URL the source is available at | ||
file: '/bundle.js' | ||
// The URL this map is available at | ||
, map: '/bundle.map' | ||
// Use this option to compress paths | ||
, compressPaths: function (p) { | ||
return path.relative('./www', p); | ||
} | ||
}; | ||
@@ -27,3 +43,3 @@ bundle.add('entryScript.js'); | ||
fs.writeFileSync('www/bundle.map', map); | ||
})); | ||
}, opts)); | ||
``` | ||
@@ -30,0 +46,0 @@ |
var optimize = require('../lib/optimize') | ||
, decouple = require('../lib/decouple') | ||
, fixtures = require('./fixtures') | ||
, browserify = require('browserify') | ||
, assert = require('assert') | ||
, path = require('path') | ||
, fs = require('fs') | ||
, _ = require('lodash') | ||
, SMConsumer = require('source-map').SourceMapConsumer | ||
, pad = function (index) { | ||
@@ -78,2 +81,25 @@ var n = new String(index).split(''); | ||
tests['optimizes backbone app'] = function (next) { | ||
var bundle = new browserify(); | ||
bundle.add(fixtures.entryScript('backbone app')); | ||
bundle.transform(require('hbsfy')); | ||
bundle.bundle({debug: true}, function (err, data) { | ||
assert.ifError(err); | ||
var minified = optimize(data, { | ||
map: 'bundle.map' | ||
, file: 'bundle.js' | ||
, compressPaths: function (p) { return path.relative(fixtures.dir, p); } | ||
}); | ||
fs.writeFileSync(fixtures.bundledFile('backbone app'), minified.code); | ||
fs.writeFileSync(fixtures.bundledMap('backbone app'), minified.map); | ||
next(); | ||
}); | ||
}; | ||
module.exports = tests; |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
19373
11084
26
580
46
0
5