Grunt server task replacement to dynamically serve coffee script as .js files
JavaScript
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
src
tasks
.gitignore
LICENCE-MIT
README.md
grunt.js
package.json

README.md

A drop-in replacement for the default Grunt server. It will serve up coffeescript files as javascript. So if you have a file in app/init.coffee, hitting http://localhost:8000/app/init.js will serve up the compiled version of that file.

Setup

You'll need to install grunt-coffeepot first:

npm install grunt-coffeepot

Then modify your grunt.js file by adding the following line:

grunt.loadNpmTasks('grunt-coffeepot');

Then add some configuration for the plugin like so:

grunt.initConfig({
  ...
  coffeepot: {
    port: 8000
    base: ./app
  },
  ...
});

port defaults to 8000 and base defaults to the grunt.js directory

To create a continuously running server use:

grunt.registerTask('serve', 'coffeepot watch');