gulp-mangle-systemjs-bundles
TypeScript icon, indicating that this package has built-in type declarations

0.0.1-alpha.2 • Public • Published

gulp-mangle-systemjs-bundles

Gulp stream to mangle the module IDs and imports/exports contained in SystemJS bundle files.

This is a very early prerelease version and should not be used by the general public. It uses fragile regex replacement that will be converted to use uglify-es's AST in the future.

Install

npm install --save-dev gulp-mangle-systemjs-bundles

Usage

gulpfile.js

const gulp = require("gulp");
const rename = require("gulp-rename");
const mangleBundles = require("gulp-mangle-systemjs-bundles");
 
//TODO: Create a better example with options, runSequence to combine bundle and config tasks.
 
const mangleOptions = {
    srcRoot: "src";
    exclude: [
        "src/keep-me"
    ]
};
 
const mangle = mangleBundles(mangleOptions);
 
gulp.task("mangle-bundles", function () {
    return gulp.src("dist/bundle/*.js")
        .pipe(mangle.bundleTransform())
        .pipe(rename({ suffix: ".min" }))
        .pipe(gulp.dest(file => file.base));
});
 
gulp.task("mangle-bundles-config", function () {
    return gulp.src("dist/jspm.config.js", { base: "dist/" })
        .pipe(mangle.configTransform())
        .pipe(rename({ suffix: ".min" }))
        .pipe(gulp.dest(file => file.base));
});
 

Package Sidebar

Install

npm i gulp-mangle-systemjs-bundles

Weekly Downloads

0

Version

0.0.1-alpha.2

License

MIT

Last publish

Collaborators

  • krisdages