generated from PrismarineJS/prismarine-template
-
Notifications
You must be signed in to change notification settings - Fork 183
/
Copy pathwebpack.dev.js
51 lines (50 loc) · 1.29 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
44
45
46
47
48
49
50
51
const { merge } = require('webpack-merge')
const common = require('./webpack.common.js')
const ReactRefreshWebpackPlugin = require('@pmmmwh/react-refresh-webpack-plugin')
/** @type {import('webpack-dev-server').Configuration['rel']} */
module.exports = merge(common,
/** @type {import('webpack').Configuration} */
{
mode: 'development',
devtool: 'inline-source-map',
cache: true,
// experiments: {
// cacheUnaffected: true,
// },
devServer: {
// contentBase: path.resolve(__dirname, './public'),
compress: true,
// inline: true,
// open: true,
hot: true,
// liveReload: true,
devMiddleware: {
writeToDisk: true,
},
port: 8081,
},
optimization: {
splitChunks: {
chunks: 'all',
maxAsyncRequests: 10,
maxInitialRequests: 10,
cacheGroups: {
minecraftData: {
test: /[\\/]node_modules[\\/]minecraft-data[\\/]/,
name: "minecraftData",
priority: 15,
chunks: 'all'
},
vendors: {
test: /[\\/]node_modules[\\/]/,
name: "vendors",
priority: 10,
chunks: 'all'
}
}
}
},
plugins: [
new ReactRefreshWebpackPlugin()
],
})