-
Notifications
You must be signed in to change notification settings - Fork 195
Grunt
Grunt Requirements - More Info
Since there is already a package.json
and a Gruntfile.js
to get started just:
- Change to the project's root directory
- Run
npm install
- Run
grunt
to make sure it works.
We use a variety of Grunt Tasks which you can see in the package.json
file and will automatically be installed win you run npm install
.
One thing to note is anytime you are pushing to Github you should always run grunt
before hand because it will make sure...
- The correct app version is applied
- The JS and CSS files are production ready
While you are in development you can use grunt dev
or even just grunt watch
which will only run what's absolutely needed in development like sass and JS file concat, which is much faster than the uglify task we use for production. Plus concat keeps the JS files pretty so it's easier to debug.
You can also utilize the /custom
folder with Grunt as well. First you may want to read about how we handle customizations here. Basically you just need to create a grunt_tasks
folder in the /custom
directory and then create a JS file for any task you want to override.
For instance, if you wanted to change how the watch task worked, you would create a watch.js
file that might look like something like this...
module.exports = {
css: {
files: ['assets/css/*.scss', 'custom/assets/css/*.scss'],
tasks: ['sass:prod']
}
}
The above will watch both our assets/css
file as well as any custom/assets/css
files as well.
One thing to note, is this will completely override our watch task in the main Gruntfile.js
so you'll probably want to make sure to start by copying what we are doing or else you could mess up the workflow.
Also, this doc will continue to improve as we finalize this new build.