grunt-extract-required

0.1.1 • Public • Published

grunt-extract-required

Build Status

A grunt task to extract commonly required modules in src files, and genenrate a JS code to use as a loader.

Using extract-required inside.

Usage

A example grunt task in Gruntfile.js :

  ...

  extract_required: {
    lib: {
      files: {
        'output/core-require.js' : [ 'lib/core/**/*.js' ]
      },
      options: {
        baseDir: 'lib/',
        ignore: [ './submodule/**/*' ],
        exposeToGlobal: true
      }
    }
  },

  ...

Options

options.baseDir

Specify a base directory to canonicalize relatively loaded module paths.

options.ignore

Specify a glob pattern or name of modules to ignore from the output.

options.exposeToGlobal

If you want to expose the generated loader function to global, set true (or custom global function name; by default it use require). Otherwise the function will be opened as a CommonJS-style module.

Readme

Keywords

none

Package Sidebar

Install

npm i grunt-extract-required

Weekly Downloads

0

Version

0.1.1

License

MIT

Last publish

Collaborators

  • stomita