-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.dev.conf.js
63 lines (62 loc) · 1.93 KB
/
webpack.dev.conf.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
/**
* Created by ximing on 2018/8/3.
*/
'use strict';
const path = require('path');
const webpack = require('webpack');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const webpackMmerge = require('webpack-merge');
const common = require('./webpack.common.config');
module.exports = webpackMmerge(common, {
mode: 'development', // "production" | "development" | "none"
entry: './src/app.js',
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'app.js',
publicPath: '/'
},
module: {
rules: [
{
test: /\.js?$/,
exclude: /(node_modules)/,
use: {
loader: 'babel-loader'
}
},
{
test: /\.html$/,
use: [
{
loader: 'html-loader',
options: {
minimize: true
}
}
]
}
]
},
devtool: 'source-map',
context: __dirname,
target: 'web',
stats: 'errors-only', // lets you precisely control what bundle information gets displayed
devServer: {
proxy: {},
contentBase: path.join(__dirname, 'public'), // boolean | string | array, static file location
compress: true, // enable gzip compression
historyApiFallback: true, // true for index.html upon 404, object for multiple paths
hot: true, // hot module replacement. Depends on HotModuleReplacementPlugin
https: false, // true for self-signed, object for cert authority
noInfo: false, // only errors & warns on hot reload
port: 9123,
host: '0.0.0.0'
},
plugins: [
new webpack.HotModuleReplacementPlugin(),
new HtmlWebpackPlugin({
template: './src/index.html',
chunksSortMode: 'none'
})
]
});