grunt-commonjs-coffee

Deprecated in favor of grunt-browserify

Deprecated in favor of grunt-browserify

grunt-commonjs-coffee

Wraps .coffee and .js files into CommonJS modules for client-side usage.

Install this grunt plugin next to your project's grunt.js gruntfile with: npm install grunt-commonjs-coffee --save-dev

Then add this line to your project's Gruntfile.coffee:

grunt.loadNpmTasks 'grunt-commonjs-coffee'

###CommonJS loader You'll need a loader to detect your wrapped packages. You can use this simple CommonJS loader which is based off how brunch.io loads CommonJS packages.

Configure which files to be copied in your initConfig:

grunt.initConfig
 
  # ... other configs 
 
  # wrap my modules with define 
  commonjs:
    modules:
      cwd: 'assets/'
      src: ['**/*.coffee''**/*.js']
      dest: 'dist/'
 
  # ... other configs 

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.

Copyright (c) 2012 Team Delicious, AVOS Systems Inc., Derek Petersen

Licensed under the MIT license.