grunt-multi-pages-assets-generator
A grunt plugin to assemble css & js for multiple pages
Getting Started
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-multi-pages-assets-generator --save-dev
Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:
grunt;
The "multi_pages_assets_generator" task
Overview
In your project's Gruntfile, add a section named multi_pages_assets_generator
to the data object passed into grunt.initConfig()
.
grunt;
Options
options.jsFolder
Type: String
Default value: ''
This folder should contain your prepared Javascript for combination
options.cssFolder
Type: String
Default value: ''
This folder should contain your prepared CSS for combination
options.configJSON
Type: String
Default value: ''
options.jsCompression
Type: Boolean
Default value: false
The js will not be compressed
options.cssCompression
Type: Boolean
Default value: false
The css will not be compressed
This file should exist and have the right values see example lower Config example
{ "pages": [{
"idName": "home",
"page": "tmp/index.html",
"css": [
"index.css",
"modules/menu.css"
],
"js": [
"index.js",
"modules/menu.js"
]
}] }
Usage Examples
Default Options
grunt;
Contributing
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.
Release History
(Nothing yet)