karma-coffee2-preprocessor
A Karma plugin. Compile CoffeeScript (version 2) on the fly.
Last updated 3 years ago by adam-lynch .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install karma-coffee2-preprocessor 
SYNC missed versions from official npm registry.

karma-coffee-preprocessor

js-standard-style npm version npm downloads

Build Status Dependency Status devDependency Status

Preprocessor to compile CoffeeScript on the fly.

Installation

The easiest way is to keep karma-coffee-preprocessor as a devDependency. 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')
      }
    },

    // make sure to include the .coffee files not the compiled .js files
    files: [
      '**/*.coffee'
    ]
  })
}

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.

Current Tags

  • 1.0.0-rc.3                                ...           latest (3 years ago)

4 Versions

  • 1.0.0-rc.3                                ...           3 years ago
  • 1.0.0-rc.2                                ...           3 years ago
  • 1.0.0-rc.1                                ...           3 years ago
  • 1.0.0-rc.0                                ...           3 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 5
Dependencies (2)
Dev Dependencies (10)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |