View our GitHub

Please visit sails-docs on GitHub to view documentation on your mobile device.

Edit Page

myApp/tasks/config/coffee.js

/**
 * Compile CoffeeScript files to JavaScript.
 *
 * ---------------------------------------------------------------
 *
 * Compiles coffeeScript files from `assest/js` into Javascript and places them into
 * `.tmp/public/js` directory.
 *
 * For usage docs see:
 *         https://github.com/gruntjs/grunt-contrib-coffee
 */
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'
            }, {
                expand: true,
                cwd: 'assets/js/',
                src: ['**/*.coffee'],
                dest: '.tmp/public/js/',
                ext: '.js'
            }]
        }
    });

    grunt.loadNpmTasks('grunt-contrib-coffee');
};

Is something missing?

If you notice something we've missed or could be improved on, please follow this link and submit a pull request to the sails-docs repo. Once we merge it, the changes will be immediately reflected on the website.