-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.test.js
65 lines (59 loc) · 1.5 KB
/
webpack.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
58
59
60
61
62
63
64
65
const { merge } = require('webpack-merge');
const common = require('./webpack.common.js');
module.exports = merge(common, {
mode: 'development',
plugins: [
new HtmlWebpackPlugin({
template: 'src/app.html',
inject: 'body',
favicon: 'src/favicon.ico',
minify: {
collapseWhitespace: isProd,
removeComments: false
}
}),
// Reference: https://github.com/webpack/extract-text-webpack-plugin
// Extract css files
// Disabled when in test mode or not in build mode
// new ExtractTextPlugin({ filename: 'css/[name].css', disable: !isProd, allChunks: true })
// new MiniCssExtractPlugin()
],
/**
* Devtool
* Reference: http://webpack.github.io/docs/configuration.html#devtool
* Type of sourcemap to use per build type
*/
devtool: 'inline-source-map',
// ISTANBUL LOADER
// https://github.com/deepsweet/istanbul-instrumenter-loader
// Instrument JS files with istanbul-lib-instrument for subsequent code coverage reporting
// Skips node_modules and files that end with .spec.js
rules: [{
enforce: 'pre',
test: /\.js$/,
exclude: [
/node_modules/,
/\.spec\.js$/
],
loader: 'istanbul-instrumenter-loader',
query: {
esModules: true
}
}],
//
// Dev server configuration
// Reference: https://webpack.js.org/configuration/dev-server/
devServer: {
contentBase: path.join(__dirname, 'dist'),
compress: true,
port: 9001,
writeToDisk: true,
proxy: {
'/api': {
target: 'http://viraweb123.ir',
secure: false,
changeOrigin: true
}
},
}
});