npm deps chat

1. Mocha Loader

允许 Mocha 通过webpack加载和运行测试

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
Copyright © tuzhu008 2017 all right reserved,powered by Gitbook该文件修订时间: 2017-11-25 11:38:22

results matching ""

    No results matching ""