Grunt task for creating custom browserify builds of mout.js.
This plugin requires Grunt ~0.4.5
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-mout --save-dev
Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:
grunt.loadNpmTasks('grunt-mout');
In your project's Gruntfile, add a section named mout
to the data object passed into grunt.initConfig()
.
grunt.initConfig({
mout: {
dist: {
options: {
modules: [
'mout/array',
'mout/object'
]
},
dest: './.tmp/mout.js'
}
}
});
Type: String
Default value: './.tmp/mout.js'
Destination file.
Type: Array
Default value: null
List of mout.js modules to include. Omit this option to include all of them.
Type: Boolean
Default value: false
Whether to include an inline source map at the bottom of the generated mout
bundle.
Type: Boolean
Default value: false
Whether to augment the generated mout
bundle with methods for recording and printing your app's usage of mout. Use this
functionality to learn what mout
modules your app uses, so you can generate a slimmer mout
build. Methods added to mout
:
An object containing the call counts.
Reset call counts to zero.
Return an array of the modules that were called. This array will be in the format required for the options.modules
option of the grunt task.
Using the default options, all mout.js modules will be included and the bundle will be written to ./.tmp/mout.js
.
grunt.initConfig({
mout: {
dist: {}
}
});
Override the destination path or specify a whitelist of mout.js modules to include (their dependencies will automatically be included) .
grunt.initConfig({
mout: {
dist: {
options: {
modules: [
'mout/array',
'mout/object',
'mout/string/typecast',
'mout/time/convert'
]
},
dest: './.tmp/mout.js'
}
}
});
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using Grunt.