-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.config.dev.js
More file actions
60 lines (58 loc) · 1.4 KB
/
webpack.config.dev.js
File metadata and controls
60 lines (58 loc) · 1.4 KB
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
const webpack = require('webpack');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const HOST = 'http://localhost';
const PORT = 8989;
const URL = `${HOST}:${PORT}`;
const ROOT = './app/src';
module.exports = {
devtool: 'cheap-eval-source-map',
entry: [
`webpack-dev-server/client?${URL}`,
'webpack/hot/dev-server',
`${ROOT}/app`
],
output: {
filename: 'app.bundle.js',
},
plugins: [
new webpack.optimize.UglifyJsPlugin({
compressor: {
warnings: false,
},
}),
new webpack.NoErrorsPlugin(),
new webpack.EvalSourceMapDevToolPlugin(),
new webpack.HotModuleReplacementPlugin(),
new HtmlWebpackPlugin({
template: `${ROOT}/index.html`
})
],
module: {
loaders: [{
test: /\.js$/,
loader: 'babel',
exclude: /(node_modules|bower_components)/
}, {
test: /\.css$/,
loaders: ['style', 'css']
}, {
test: /\.html$/,
loader: 'raw-loader'
}, {
test: /\.woff(2)?(\?v=[0-9]\.[0-9]\.[0-9])?$/,
loader: 'url?limit=10000&mimetype=application/font-woff&name=fonts/[name].[ext]'
}, {
test: /\.(ttf|eot|svg)(\?v=[0-9]\.[0-9]\.[0-9])?$/,
loader: 'file?name=fonts/[name].[ext]'
}, {
test: /\.(jp(e)g|gif|png)?$/,
loader: 'file?name=img/[name].[ext]'
}]
},
devServer: {
contentBase: ROOT,
port: PORT,
hot: true,
inline: true
}
};