-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathwebpack.develop.config.babel.js
69 lines (64 loc) · 1.73 KB
/
webpack.develop.config.babel.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
66
67
68
69
import path from 'path'
import webpack from 'webpack'
import WebpackMerger from 'webpack-merge'
import HtmlWebpackPlugin from 'html-webpack-plugin'
import WebpackConf from './webpack.common.config.babel'
import { srcDir, distDir } from './variables'
const DefinePlugin = webpack.DefinePlugin
export default WebpackMerger(WebpackConf, {
devtool: 'source-map',
entry: {
index: path.join(srcDir, './index.js'),
frame: path.join(srcDir, './frame.js')
},
devServer: {
// It suppress error shown in console, so it has to be set to false.
quiet: false,
// It suppress everything except error, so it has to be set to false as well
// to see success build.
noInfo: false,
stats: {
// only warning and error informations
// docs: https://webpack.js.org/configuration/stats/
colors: true,
warnings: true,
errors: true,
errorDetails: true,
version: false,
assets: false,
cached: false,
cachedAssets: false,
modules: false,
moduleTrace: false,
chunks: false,
chunkModules: false,
chunkOrigins: false,
children: false,
hash: false,
timings: false
},
hot: true,
inline: true,
disableHostCheck: true
},
plugins: [
/**
* Define some global variables
*/
new DefinePlugin({
'process.env': {
development: JSON.stringify(true)
}
}),
new HtmlWebpackPlugin({
filename: path.join(distDir, './index.html'),
template: path.join(srcDir, './index.pug'),
excludeChunks: ['frame']
}),
new HtmlWebpackPlugin({
filename: path.join(distDir, './frame.html'),
template: path.join(srcDir, './frame.pug'),
excludeChunks: ['index']
})
]
})