-
Notifications
You must be signed in to change notification settings - Fork 7
/
webpack.dev.config.js
47 lines (45 loc) · 1.19 KB
/
webpack.dev.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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
const webpack = require('webpack');
const merge = require('webpack-merge');
const path = require('path');
const BrowserSyncPlugin = require('browser-sync-webpack-plugin');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const common = require('./webpack.common.config.js');
// Dashboard
const Dashboard = require('webpack-dashboard');
const DashboardPlugin = require('webpack-dashboard/plugin');
const dashboard = new Dashboard();
module.exports = merge(common, {
plugins: [
new DashboardPlugin(dashboard.setData),
new webpack.NamedModulesPlugin(),
new webpack.HotModuleReplacementPlugin(),
new BrowserSyncPlugin(
{
host: 'localhost',
port: 3001,
proxy: 'http://localhost:8080/',
logLevel: "silent",
files: [
{
match: ['**/*.html'],
fn: (event) => {
if (event === 'change') {
const bs = require('browser-sync').get('bs-webpack-plugin');
bs.reload();
}
},
},
],
},
{ reload: false }
),
],
devServer: {
hot: false, // Tell the dev-server we're using HMR
quiet: true,
contentBase: path.resolve(__dirname, 'public'),
publicPath: '/',
},
watch: true,
// devtool: 'cheap-eval-source-map',
});