sbm

systemjs-bundle-minify

Minification specific to SystemJS self-executing bundles

Showing:

Popularity

Downloads/wk

7

GitHub Stars

1

Maintenance

Last Commit

6yrs ago

Contributors

1

Package

Dependencies

3

Size (min+gzip)

86.9KB

License

MIT

Type Definitions

Tree-Shakeable

No?

Categories

Readme

SystemJS Bundle Minifier Build Status

NPM

This package contains special minification utilities for SystemJS self-executing bundles. Currently it supports the following:

  • Minify modules names i.e. github:jspm/some-really-long-module@1.2.3 -> 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

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100