systemjs-bundle-minify
v1.0.6
Published
Contains minifier utilities specific to SystemJS self-executing bundles
Downloads
4
Readme
SystemJS Bundle Minifier
This package contains special minification utilities for SystemJS self-executing bundles. Currently it supports the following:
- Minify modules names i.e.
github:jspm/[email protected]
->a
Installation
From NPM:
npm install systemjs-bundle-minify
Usage
var minifier = require('systemjs-bundle-minify');
// SystemJS builder
builder.buildSFX('myModule.js', options)
.then(function (output) {
return minifier.minifyModuleNames(output.source);
});
Module maps
The returned string object has a moduleMap
field that allows you to inspect the correspondence between modules names before and after minification.
builder.buildSFX('myModule.js', options)
.then(function (output) {
var code = minifier.minifyModuleNames(output.source);
for (var key in code.moduleMap) {
console.log(key, '->', code.moduleMap[key]));
}
});
// Output:
// adderModule -> 0
// callerModule -> 1
// mainModule -> 2