arian / partition-bundle

A browserify plugin to partition your modules in different bundles
114 stars 18 forks source link

api usage example for README.md #30

Open cordovapolymer opened 7 years ago

cordovapolymer commented 7 years ago

build.js

var browserify = require('browserify');
var b = browserify(['./a', './b']);

var output = './src';
b.plugin('partition-bundle', { map: './bundle.json', output: output, main: './a' });
b.bundle();

bundle.json

{
  "./a.js": ["./a"],
  "./b.js": ["./b"]
}
kristoferjoseph commented 7 years ago

example npm build script: https://gist.github.com/kristoferjoseph/921160c70967e31dbcf45b4642e73b69