Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

minifyify

Package Overview
Dependencies
Maintainers
1
Versions
98
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

minifyify - npm Package Compare versions

Comparing version 0.2.0 to 0.2.1

test/fixtures/backbone app/entry.js

5

package.json

@@ -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": {},

22

Readme.md

@@ -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;
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc