-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.test.config.js
33 lines (31 loc) · 1.07 KB
/
webpack.test.config.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
const path = require('path');
const webpack = require('webpack');
const HtmlwebpackPlugin = require('html-webpack-plugin');
const merge = require('webpack-merge')
const baseConfig = require('./webpack.base.config.js');
const ROOT_PATH = path.resolve(__dirname);
const SRC_PATH = path.resolve(ROOT_PATH, 'src');
const testConfig = merge(baseConfig, {
plugins: [
new webpack.DefinePlugin({
'process.env.NODE_ENV': '"test"'
}),
new webpack.optimize.UglifyJsPlugin({
sourceMap: true,
}),
new HtmlwebpackPlugin({
title: 'react-redux-scaffold',
filename: 'index.html',
template: path.resolve(SRC_PATH, 'templates', 'index.html'),
minify: {
removeComments: true,
collapseWhitespace: true,
removeRedundantAttributes: true,
removeScriptTypeAttributes: true,
removeStyleLinkTypeAttributes: true,
removeAttributeQuotes: true
}
})
]
});
module.exports = testConfig;