This project is no longer continoued. I don't use snockets anymore and highly recommend to use require.js instead! I no longer see any necassary to use a tool like snockets, sorry :)
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 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);
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.