pages235/webpack.dev.js
Vitaly 53e8478413 inventories are almost here wip:
add mobile button
review upstream
wip react refresh (thats why migrating to react)
to migrate to tsx
to impl advanced settings
2023-08-22 05:03:36 +03:00

51 lines
1.3 KiB
JavaScript

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()
],
})