plumber-requirejs

RequireJS (r.js) operation for Plumber pipelines


Keywords
build, assets, pipeline, plumber
License
GPL-2.0+
Install
npm install plumber-requirejs@0.4.1

Documentation

plumber-requirejs Build Status

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.