1.1. Install
npm install --save-dev mocha-loader
1.2. 用法
1.2.1. 配置 (推荐)
webpack.config.js
module.exports = {
entry: './entry.js',
output: {
path: __dirname,
filename: 'bundle.js'
},
module: {
rules: [{
test: /test\.js$/,
use: 'mocha-loader',
exclude: /node_modules/,
}]
}
}
import test from './test'
1.2.2. CLI
webpack --module-bind 'mocha-loader!./test'
import test from './test'
1.2.3. Require
import test from 'mocha-loader!./test'
1.3. 选项
1.4. 维护者
Juho Vepsäläinen |
Joshua Wiens |
Kees Kluskens |
Sean Larkin |