grunt-modulize
Browserify and Factor-Bundle plugin for Grunt.
Getting Started
This plugin requires Grunt.
If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:
npm install grunt-modulize --save-dev
Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:
grunt.loadNpmTasks('grunt-modulize');
The "modulize" task
Overview
In your project's Gruntfile, add a section named modulize
to the data object passed into grunt.initConfig()
.
grunt.initConfig({
modulize: {
modules: [],
output: '',
bundle: ''
}
})
Options
modules
Type: Array
Files to be parsed by Browserify
output
Type: String
Path where bundled scripts should be placed.
bundle
Type: String
Filename for the generated common script bundle.
Usage Examples
Identify any modules you want Browserified in the modules
section, map the final output directory in output
, and identify the output of the common bundle script in bundle
.
Any missing directories identified by output
or bundle
will be created dynamically by Grunt.
grunt.initConfig({
modulize: {
all: {
modules: [
'assets/js/src/first.js',
'assets/js/src/second.js'
],
output: 'assets/js',
bundle: 'assets/js/common.js'
}
})
Release History
- 2015-10-08 v1.0.1 Fix dependencies
- 2015-10-08 v1.0.0 Initial release
License
Copyright © 2015 Eric Mann. Licensed under the MIT license.