grunt-snockets

Snockets for grunt.js

npm install grunt-snockets
1 downloads in the last day
4 downloads in the last week
68 downloads in the last month

grunt-snockets

Snockets for grunt.js

Getting Started

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');

Documentation (Basic Usage)

coffee/components/ctabs.coffee

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

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(k, v) {
        return console.log(k, v);
      });
    }

    return CTabs;

  })();

}).call(this);

(function() {

  $(function() {
    return console.log('Hello my friend ^^');
  });

}).call(this);

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)

License

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

npm loves you