-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathwebpack.config-test.js
57 lines (56 loc) · 1.63 KB
/
webpack.config-test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
const path = require('path');
const webpack = require('webpack');
var nodeExternals = require('webpack-node-externals');
module.exports = {
target: "node",
output: {
devtoolModuleFilenameTemplate: '[absolute-resource-path]',
devtoolFallbackModuleFilenameTemplate: '[absolute-resource-path]?[hash]'
},
resolve: {
alias: {
'@lib': path.resolve(__dirname, 'src/lib')
},
modules: [
'node_modules'
]
},
module: {
rules: [
{
test: /\.(js)/,
include: path.resolve('src'),
exclude: /node_modules/,
use: [
{
loader: 'istanbul-instrumenter-loader',
query: {
esModules: true
}
},
{
loader: 'babel-loader',
options: {
presets: [
'@babel/preset-env'
],
plugins: [
'@babel/plugin-syntax-dynamic-import',
'@babel/plugin-transform-regenerator'
]
}
}
]
}
]
},
plugins: [
new webpack.DefinePlugin({
'process.env': {
MOCHA_TEST: JSON.stringify(true)
}
})
],
externals: [nodeExternals()],
devtool: "inline-cheap-module-source-map"
}