-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
42 lines (40 loc) · 1.05 KB
/
webpack.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
const path = require('path')
const { CleanWebpackPlugin } = require('clean-webpack-plugin')
const HtmlWebpackPlugin = require('html-webpack-plugin')
const port = 4200
module.exports = () => {
return {
entry: './app/index.js',
resolve: {
mainFields: ['main', 'module', 'browser'],
alias: {
'@': path.resolve(__dirname, 'app/')
},
fallback: {
// NOTE: required by dash.js, since Webpack 5 doesn't provide Node fallbacks
buffer: require.resolve('safe-buffer'),
stream: require.resolve('stream-browserify'),
util: require.resolve('util/')
}
},
output: {
filename: '[name].[contenthash].js',
// eslint-disable-next-line no-undef
path: path.resolve(__dirname, 'dist')
},
plugins: [
new CleanWebpackPlugin(),
new HtmlWebpackPlugin({
template: './index.html'
})
],
devServer: {
host: '0.0.0.0',
openPage: `http://localhost:${port}`,
port,
hot: true,
overlay: true
},
devtool: 'source-map'
}
}