mocha-loader

安装

npm install --save-dev mocha-loader

用法

配置(推荐)

webpack.config.js


module.exports = {
  entry: './entry.js',
  output: {
    path: __dirname,
    filename: 'bundle.js'
  },
  modules: {
    rules: [{
      test: /test.js$/,
      use: 'mocha-loader',
      exclude: /node_modules/,
    }]
  }
}
import test from './test'

命令行接口(CLI)

webpack --module-bind 'mocha-loader!./test'
import test from './test'

Require

import test from 'mocha-loader!./test'

选项

维护人员


Juho Vepsäläinen

Joshua Wiens

Kees Kluskens

Sean Larkin

原文:https://webpack.js.org/loaders/mocha-loader/

results matching ""

    No results matching ""