-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.dev.js
43 lines (34 loc) · 1.06 KB
/
webpack.dev.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
const { merge } = require('webpack-merge');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const path = require("path");
const config = require('./webpack.config.js');
require("regenerator-runtime"); // Import it in all the files using async/await
// const WorkboxPlugin = require('workbox-webpack-plugin'); // For Service Workers
module.exports = merge(config, {
mode: 'development',
devtool: 'inline-source-map',
optimization: { // Tree shaking
usedExports: true,
},
cache: false,
devServer: {
static: {
directory: path.join(__dirname, 'public'),
},
compress: true,
port: 3000,
hot: true
},
// Uncomment before final deployment.
plugins: [
new HtmlWebpackPlugin ({
title: 'Development', // For PWA: 'Progressive Wep Application'
template : 'public/index.html'
}),
// new WorkboxPlugin.GenerateSW({ // For Service Workers
// clientsClaim: true,
// skipWaiting: true,
// maximumFileSizeToCacheInBytes: 5*1024*1024
// }),
]
});