minify

  • function
steal-tools.streams.minify  

Given a stream of BuildResult objects, minify the source of each module in each bundle. This is the default behavior of StealTool's multi-build.

stealTools.streams.minify()

Returns

{Stream<BuildResult>}

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

Use

This stream minifies the modules in a dependency graph. Instead of minifying the entire bundle once concatenated, this will minify each module individually.

This API must be used in conjuction with graph.

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

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

var minifyStream = graphStream.pipe(s.transpile())
    .pipe(s.minify());

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