plumber-requirejs

0.4.1 • Public • Published

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.

Package Sidebar

Install

npm i plumber-requirejs

Weekly Downloads

9

Version

0.4.1

License

GPL

Last publish

Collaborators

  • theefer