-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.dev.cjs
29 lines (28 loc) · 1009 Bytes
/
webpack.dev.cjs
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
const merge = require('webpack-merge');
const common = require('./webpack.common.cjs');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const { CleanWebpackPlugin } = require('clean-webpack-plugin');
module.exports = merge(common, {
mode: 'development',
devtool: 'inline-source-map',
devServer: {
// Use empty serve directory, not dist, else will attempt to serve all separate production
// JS files and fail (WebSocket connection issues)
contentBase: './serve',
hot: true
},
entry: {
// Include the SwAK app only in testing
appcss: './app.scss',
app: './app.js'
},
plugins: [
// Changing the template recompiles but does not trigger reload. Reload the browser manually.
// Known issue: https://github.com/jantimon/html-webpack-plugin/issues/100
new HtmlWebpackPlugin({
template: 'index.html',
scriptLoading: 'defer',
inject: 'body'
})
]
});