Skip to content

A Karma plugin. Compile coffee script on the fly.

License

Notifications You must be signed in to change notification settings

voxy/karma-coffee-preprocessor

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

46 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

karma-coffee-preprocessor

Preprocessor to compile CoffeeScript on the fly.

Installation

The easiest way is to keep karma-coffee-preprocessor as a devDependency in your package.json.

{
  "devDependencies": {
    "karma": "~0.10",
    "karma-coffee-preprocessor": "~0.1"
  }
}

You can simple do it by:

npm install karma-coffee-preprocessor --save-dev

Configuration

Following code shows the default configuration...

// karma.conf.js
module.exports = function(config) {
  config.set({
    preprocessors: {
      '**/*.coffee': ['coffee']
    },

    coffeePreprocessor: {
      // options passed to the coffee compiler
      options: {
        bare: true,
        sourceMap: false
      },
      // transforming the filenames
      transformPath: function(path) {
        return path.replace(/\.coffee$/, '.js');
      }
    }
  });
};

If you set the sourceMap coffee compiler option to true then the generated source map will be inlined as a data-uri.


For more information on Karma see the homepage.

About

A Karma plugin. Compile coffee script on the fly.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 72.0%
  • CoffeeScript 28.0%