river-of-ebooks/tasks/config/coffee.js

55 lines
1.5 KiB
JavaScript

/**
* `tasks/config/coffee`
*
* ---------------------------------------------------------------
*
* Compile CoffeeScript files located in `assets/js` into Javascript
* and generate new `.js` files in `.tmp/public/js`.
*
* For more information, see:
* https://sailsjs.com/anatomy/tasks/config/coffee.js
*
*/
module.exports = function (grunt) {
grunt.config.set('coffee', {
dev: {
options: {
bare: true,
sourceMap: true,
sourceRoot: './'
},
files: [{
expand: true,
cwd: 'assets/js/',
src: ['**/*.coffee'],
dest: '.tmp/public/js/',
ext: '.js'
}]
}
})
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// This Grunt plugin is part of the default asset pipeline in Sails,
// so it's already been automatically loaded for you at this point.
//
// Of course, you can always remove this Grunt plugin altogether by
// deleting this file. But check this out: you can also use your
// _own_ custom version of this Grunt plugin.
//
// Here's how:
//
// 1. Install it as a local dependency of your Sails app:
// ```
// $ npm install grunt-contrib-coffee --save-dev --save-exact
// ```
//
//
// 2. Then uncomment the following code:
//
// ```
// // Load Grunt plugin from the node_modules/ folder.
// grunt.loadNpmTasks('grunt-contrib-coffee');
// ```
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
}