Skip to content

godmodelabs/coffee-loader

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

npm node deps tests coverage chat

Coffee Loader

Loads CoffeeScript like JavaScript

Install

npm install --save-dev coffee-loader

Usage

import coffee from 'coffee-loader!./file.coffee';

Configuration (recommended)

import coffee from 'file.coffee';

webpack.config.js

module.exports = {
  module: {
    rules: [
      {
        test: /\.coffee$/,
        use: [ 'coffee-loader' ]
      }
    ]
  }
}

Options

Name Default Description
literate false Enable CoffeeScript in Markdown (Code Blocks) e.g file.coffee.md
transpile false Provide Babel presets and plugins

webpack.config.js

module.exports = {
  module: {
    rules: [
      {
        test: /\.coffee.md$/,
        use: [
          {
            loader: 'coffee-loader',
            options: { literate: true }
          }
        ]
      }
    ]
  }
}

Sourcemaps

Source maps are always produced.

webpack.config.js

module.exports = {
  module: {
    rules: [
      {
        test: /\.coffee$/,
        use: [
          {
            loader: 'coffee-loader',
            options: { 
              transpile: {
                presets: ['env']
              }
            }
          }
        ]
      }
    ]
  }
}

Maintainer


Juho Vepsäläinen

Joshua Wiens

Kees Kluskens

Sean Larkin

Packages

No packages published

Languages

  • JavaScript 100.0%