1. karma-coffee-preprocessor
A Karma plugin. Compile coffee script on the fly.
karma-coffee-preprocessor
Package: karma-coffee-preprocessor
Created by: karma-runner
Last modified: Sun, 19 Jun 2022 07:55:30 GMT
Version: 1.0.1
License: MIT
Downloads: 90,435
Repository: https://github.com/karma-runner/karma-coffee-preprocessor

Install

npm install karma-coffee-preprocessor
yarn add karma-coffee-preprocessor

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.

RELATED POST

10 Must-Know Windows Shortcuts That Will Save You Time

10 Must-Know Windows Shortcuts That Will Save You Time

Arrays vs Linked Lists: Which is Better for Memory Management in Data Structures?

Arrays vs Linked Lists: Which is Better for Memory Management in Data Structures?

Navigating AWS Networking: Essential Hacks for Smooth Operation

Navigating AWS Networking: Essential Hacks for Smooth Operation

Achieving Stunning Visuals with Unity's Global Illumination

Achieving Stunning Visuals with Unity's Global Illumination

Nim's Hidden Gems: Lesser-known Features for Writing Efficient Code

Nim's Hidden Gems: Lesser-known Features for Writing Efficient Code