Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

karma-coffee-preprocessor

karma-runner94.5kMIT1.0.1

A Karma plugin. Compile coffee script on the fly.

karma-plugin, karma-preprocessor, coffee-script, coffee

readme

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.

changelog

1.0.1 (2016-07-12)

Bug Fixes

  • use object-assign to stop deprecation notice (#36) (769283e)
  • warnings in chrome. (acc1bce)

<a name"1.0.0">

1.0.0 (2016-05-03)

<a name"0.3.0">

0.3.0 (2015-07-09)

Features

  • Depend on any 1.* version of coffee-script (ed41be72)

<a name"0.2.1">

0.2.1 (2015-07-09)

<a name"0.2.0">

0.2.0 (2015-07-09)

Features

<a name"0.1.3">

0.1.3 (2015-07-09)

Features

  • update coffee script to 1.7 (fec5e821)

<a name"0.1.2">

0.1.2 (2015-07-09)

Features

  • support source maps (rewriting stack traces) (f1d5e7ef)

<a name"0.1.1">

0.1.1 (2015-07-09)

Features

  • add a line number to the error log if there is a parse error (56315e16)

<a name"0.1.0">

0.1.0 (2015-07-09)

<a name"0.0.4">

0.0.4 (2015-07-09)

Bug Fixes

  • append sourceMappingURL, per spec (7a330c57)
  • missing var (63b402ac)
  • don't error out when coffee compilation fails (4a8074b5)

Features

<a name"0.0.3">

0.0.3 (2015-07-09)

Bug Fixes

  • actually pass cloned options to coffee.compile (01a3e094)
  • clone mutable options (6722fa44)

Features

  • config: upgrade coffee-script to 1.6.3 (202b8930)

<a name"0.0.2">

0.0.2 (2015-07-09)

Bug Fixes

  • don't suffix filename with -compiled.js (14b1835a)

Features

  • make options, transformPath configurable (486abccb, closes #1)