Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JSPM multiple bundles, vendor and app

Bundling with JSPM is easy, here is a simple task:

var exec = require('child_process').exec;

gulp.task('jspmBuild', function (cb) {
        exec('jspm bundle-sfx src/app/app.js dist/app.min.js --skip-source-maps', function (err, stdout, stderr) {
            cb(err);
        });
    });

What I would like to do, is have two separate bundles, one for the vendor files and one for the actual app.

Is that possible?

like image 671
Dany D Avatar asked Aug 22 '15 01:08

Dany D


1 Answers

See https://github.com/jspm/jspm-cli/blob/master/docs/production-workflows.md

and try

$ jspm bundle-sfx vendor1 + vendor2 dist/vendor.min.js --skip-source-maps
$ jspm bundle-sfx src/app/app.js - vendor1 - vendor2 dist/app.min.js --skip-source-maps

See also https://github.com/systemjs/systemjs/blob/master/docs/config-api.md#packages

You can configure more complex settings with packages option if you want.

like image 107
Yuki Takei Avatar answered Nov 13 '22 14:11

Yuki Takei