plumber-requirejs
v0.4.1
Published
RequireJS (r.js) operation for Plumber pipelines
Downloads
13
Readme
plumber-requirejs
RequireJS compilation operation for Plumber pipelines.
Example
var requirejs = require('plumber-requirejs');
module.exports = function(pipelines) {
pipelines['compile'] = [
glob('app.js'),
requirejs({
paths: {
// Help resolve paths
'lodash-modern': '../bower_components/lodash-amd/modern',
// Not compiled in
moment: 'empty:'
}
}),
// ... more pipeline operations
];
};
API
requirejs(requireJsOptions)
Compile each input JavaScript input resource using RequireJS (or r.js
). The resulting JavaScript resource will include all the AMD dependencies of the original resource.
Optionally, custom options can be passed to RequireJS (see the example build file for a full list).
Note that you should not specify input/output configuration options, such as name
, out
or baseUrl
; these are automatically inferred and managed by the input resources.
Source maps for all input resources will be updated or generated accordingly.