coffee-loader
Install
npm install --save-dev coffee-loader
用法
import coffee from 'coffee-loader!./file.coffee';
配置(推荐)
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 |
sourceMap |
false |
Enable/Disable Sourcemaps |
Literate
webpack.config.js
module.exports = {
module: {
rules: [
{
test: /\.coffee.md$/,
use: [
{
loader: 'coffee-loader',
options: { literate: true }
}
]
}
]
}
}
Sourcemaps
webpack.config.js
module.exports = {
module: {
rules: [
{
test: /\.coffee$/,
use: [
{
loader: 'coffee-loader',
options: { sourceMap: true }
}
]
}
]
}
}
Maintainer
Juho Vepsäläinen |
Joshua Wiens |
Kees Kluskens |
Sean Larkin |