-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.test.js
48 lines (48 loc) · 1.54 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
const path = require('path')
const nodeExternals = require('webpack-node-externals')
const tsconfigPathsPlugin = require('tsconfig-paths-webpack-plugin')
const isCoverage = process.env.NODE_ENV === 'unit_test'
const FilterWarningsPlugin = require('webpack-filter-warnings-plugin')
console.log(isCoverage)
module.exports = {
devtool: 'inline-cheap-module-source-map',
mode: 'development',
target: 'node',
externals: [nodeExternals()],
resolve: {
extensions: ['.js', '.json', '.ts', '.tsx'],
plugins: [new tsconfigPathsPlugin()]
},
plugins: [
new FilterWarningsPlugin({
exclude: [
/Critical dependency: the request of a dependency is an expression/,
/require.extensions is not supported by webpack. Use a loader instead./
]
})
],
output: {
devtoolModuleFilenameTemplate: '[absolute-resource-path]',
devtoolFallbackModuleFilenameTemplate: '[absolute-resource-path]?[hash]'
},
module: {
rules: [
{
test: /\.ts$/,
include: [
path.resolve(__dirname, 'src'),
path.resolve(__dirname, 'test')
],
loader: 'istanbul-instrumenter-loader'
},
{
test: /\.ts$/,
include: [
path.resolve(__dirname, 'src'),
path.resolve(__dirname, 'test')
],
loader: 'ts-loader'
}
]
}
}