Upgrade to Webpack 5 (#83)
Reviewed-on: https://codeberg.org/superseriousbusiness/masto-fe-standalone/pulls/83 Co-authored-by: Zoë Bijl <code@moiety.me> Co-committed-by: Zoë Bijl <code@moiety.me>
This commit is contained in:
@@ -17,7 +17,7 @@ if (process.env.VAGRANT) {
|
||||
module.exports = merge(sharedConfig, {
|
||||
mode: 'development',
|
||||
cache: true,
|
||||
devtool: 'cheap-module-eval-source-map',
|
||||
devtool: 'eval-cheap-module-source-map',
|
||||
|
||||
stats: {
|
||||
errorDetails: true,
|
||||
@@ -28,35 +28,37 @@ module.exports = merge(sharedConfig, {
|
||||
},
|
||||
|
||||
devServer: {
|
||||
clientLogLevel: 'none',
|
||||
compress: settings.dev_server.compress,
|
||||
quiet: settings.dev_server.quiet,
|
||||
disableHostCheck: settings.dev_server.disable_host_check,
|
||||
host: settings.dev_server.host,
|
||||
port: settings.dev_server.port,
|
||||
https: settings.dev_server.https,
|
||||
hot: settings.dev_server.hmr,
|
||||
contentBase: settings.public_root_path,
|
||||
inline: settings.dev_server.inline,
|
||||
useLocalIp: settings.dev_server.use_local_ip,
|
||||
public: settings.dev_server.public,
|
||||
publicPath: output.publicPath,
|
||||
historyApiFallback: {
|
||||
disableDotRule: true,
|
||||
},
|
||||
headers: settings.dev_server.headers,
|
||||
overlay: settings.dev_server.overlay,
|
||||
stats: {
|
||||
entrypoints: false,
|
||||
errorDetails: false,
|
||||
modules: false,
|
||||
moduleTrace: false,
|
||||
client: {
|
||||
logging: 'none',
|
||||
overlay: settings.dev_server.overlay,
|
||||
},
|
||||
watchOptions: Object.assign(
|
||||
{},
|
||||
settings.dev_server.watch_options,
|
||||
watchOptions,
|
||||
),
|
||||
writeToDisk: filePath => /ocr/.test(filePath),
|
||||
static: {
|
||||
directory: settings.public_root_path,
|
||||
serveIndex: true,
|
||||
watch: Object.assign(
|
||||
{},
|
||||
settings.dev_server.watch_options,
|
||||
watchOptions,
|
||||
),
|
||||
},
|
||||
devMiddleware: {
|
||||
publicPath: output.publicPath,
|
||||
stats: {
|
||||
entrypoints: false,
|
||||
errorDetails: false,
|
||||
modules: false,
|
||||
moduleTrace: false,
|
||||
},
|
||||
writeToDisk: filePath => /ocr/.test(filePath)
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
@@ -23,9 +23,7 @@ module.exports = merge(sharedConfig, {
|
||||
minimize: true,
|
||||
minimizer: [
|
||||
new TerserPlugin({
|
||||
cache: true,
|
||||
parallel: true,
|
||||
sourceMap: true,
|
||||
}),
|
||||
],
|
||||
},
|
||||
|
||||
@@ -72,7 +72,7 @@ module.exports = {
|
||||
splitChunks: {
|
||||
cacheGroups: {
|
||||
default: false,
|
||||
vendors: false,
|
||||
vendorsVendors: false,
|
||||
common: {
|
||||
name: 'common',
|
||||
chunks (chunk) {
|
||||
@@ -84,7 +84,8 @@ module.exports = {
|
||||
},
|
||||
},
|
||||
},
|
||||
occurrenceOrder: true,
|
||||
chunkIds: 'total-size',
|
||||
moduleIds: 'size'
|
||||
},
|
||||
|
||||
module: {
|
||||
@@ -127,10 +128,4 @@ module.exports = {
|
||||
resolveLoader: {
|
||||
modules: ['node_modules'],
|
||||
},
|
||||
|
||||
node: {
|
||||
// Called by http-link-header in an API we never use, increases
|
||||
// bundle size unnecessarily
|
||||
Buffer: false,
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user