grunt-snockets

Snockets for grunt.js

grunt-snockets

Snockets for grunt.js

Install this grunt plugin next to your project's grunt.js gruntfile with: npm install grunt-snockets

Then add this line to your project's grunt.js gruntfile:

grunt.loadNpmTasks('grunt-snockets');

coffee/components/ctabs.coffee

class CTabs
    constructor: (tabs) ->
        tabs.each (k, v) ->
            console.log kv

coffee/app.coffee

#= require_tree components 
->
    console.log 'Hello my friend ^^'

grunt conifg

grunt.initConfig({
    snockets: {
        compile: {
            src: 'coffee/app.coffee',
            dest: 'public/js/app.js'
        }
    }
})

Finally public/js/app.js become:

(function() {
  var CTabs;
 
  CTabs = (function() {
 
    function CTabs(tabs) {
      tabs.each(function(kv) {
        return console.log(k, v);
      });
    }
 
    return CTabs;
 
  })();
 
}).call(this);
 
(function() {
 
  $(function() {
    return console.log('Hello my friend ^^');
  });
 
}).call(this);

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.

(Nothing yet)

Copyright (c) 2013 Umur Gedik
Licensed under the MIT license.