You're Invited: Meet the Socket team at BSidesSF and RSAC - April 27 - May 1.RSVP
Socket
Sign inDemoInstall
Socket

grunt-extract-required

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

grunt-extract-required

Grunt task to extract required modules in src files

0.1.1
latest
npm
Version published
Weekly downloads
9
800%
Maintainers
1
Weekly downloads
 
Created
Source

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.

FAQs

Package last updated on 23 Aug 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts