bundle

  • function
steal-tools.streams.bundle  

The bundle stream takes a stream of BuildResult objects and applies a progressive loading algorithm to split the graph into separate bundles optimized for fast loading.

stealTools.streams.bundle()

Returns

{Stream<BuildResult>}

A stream of objects that contains the dependency graph, with each module having been minified.

Use

Given a graph stream, you should first transpile and minify before applying the bundle stream:

var s = require("steal-tools").streams;

var graphStream = s.graph({
    config: __dirname + "/package.json!npm"
}, {
    minify: false
});

var buildStream = graphStream
    .pipe(s.transpile())
    .pipe(s.minify())
    .pipe(s.bundle());

minifyStream.on("data", function(data){
    var bundles = s.bundles;
});
Help us improve StealJS by taking our community survey