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, {
|
module.exports = merge(sharedConfig, {
|
||||||
mode: 'development',
|
mode: 'development',
|
||||||
cache: true,
|
cache: true,
|
||||||
devtool: 'cheap-module-eval-source-map',
|
devtool: 'eval-cheap-module-source-map',
|
||||||
|
|
||||||
stats: {
|
stats: {
|
||||||
errorDetails: true,
|
errorDetails: true,
|
||||||
@@ -28,35 +28,37 @@ module.exports = merge(sharedConfig, {
|
|||||||
},
|
},
|
||||||
|
|
||||||
devServer: {
|
devServer: {
|
||||||
clientLogLevel: 'none',
|
|
||||||
compress: settings.dev_server.compress,
|
compress: settings.dev_server.compress,
|
||||||
quiet: settings.dev_server.quiet,
|
|
||||||
disableHostCheck: settings.dev_server.disable_host_check,
|
|
||||||
host: settings.dev_server.host,
|
host: settings.dev_server.host,
|
||||||
port: settings.dev_server.port,
|
port: settings.dev_server.port,
|
||||||
https: settings.dev_server.https,
|
https: settings.dev_server.https,
|
||||||
hot: settings.dev_server.hmr,
|
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: {
|
historyApiFallback: {
|
||||||
disableDotRule: true,
|
disableDotRule: true,
|
||||||
},
|
},
|
||||||
headers: settings.dev_server.headers,
|
headers: settings.dev_server.headers,
|
||||||
overlay: settings.dev_server.overlay,
|
client: {
|
||||||
stats: {
|
logging: 'none',
|
||||||
entrypoints: false,
|
overlay: settings.dev_server.overlay,
|
||||||
errorDetails: false,
|
|
||||||
modules: false,
|
|
||||||
moduleTrace: false,
|
|
||||||
},
|
},
|
||||||
watchOptions: Object.assign(
|
static: {
|
||||||
{},
|
directory: settings.public_root_path,
|
||||||
settings.dev_server.watch_options,
|
serveIndex: true,
|
||||||
watchOptions,
|
watch: Object.assign(
|
||||||
),
|
{},
|
||||||
writeToDisk: filePath => /ocr/.test(filePath),
|
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,
|
minimize: true,
|
||||||
minimizer: [
|
minimizer: [
|
||||||
new TerserPlugin({
|
new TerserPlugin({
|
||||||
cache: true,
|
|
||||||
parallel: true,
|
parallel: true,
|
||||||
sourceMap: true,
|
|
||||||
}),
|
}),
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ module.exports = {
|
|||||||
splitChunks: {
|
splitChunks: {
|
||||||
cacheGroups: {
|
cacheGroups: {
|
||||||
default: false,
|
default: false,
|
||||||
vendors: false,
|
vendorsVendors: false,
|
||||||
common: {
|
common: {
|
||||||
name: 'common',
|
name: 'common',
|
||||||
chunks (chunk) {
|
chunks (chunk) {
|
||||||
@@ -84,7 +84,8 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
occurrenceOrder: true,
|
chunkIds: 'total-size',
|
||||||
|
moduleIds: 'size'
|
||||||
},
|
},
|
||||||
|
|
||||||
module: {
|
module: {
|
||||||
@@ -127,10 +128,4 @@ module.exports = {
|
|||||||
resolveLoader: {
|
resolveLoader: {
|
||||||
modules: ['node_modules'],
|
modules: ['node_modules'],
|
||||||
},
|
},
|
||||||
|
|
||||||
node: {
|
|
||||||
// Called by http-link-header in an API we never use, increases
|
|
||||||
// bundle size unnecessarily
|
|
||||||
Buffer: false,
|
|
||||||
},
|
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -59,17 +59,18 @@ development:
|
|||||||
# Reference: https://webpack.js.org/configuration/dev-server/
|
# Reference: https://webpack.js.org/configuration/dev-server/
|
||||||
dev_server:
|
dev_server:
|
||||||
https: false
|
https: false
|
||||||
host: 0.0.0.0
|
|
||||||
port: 3035
|
port: 3035
|
||||||
public: localhost:3035
|
webSocketURL:
|
||||||
|
hostname: '0.0.0.0'
|
||||||
|
pathname: '/ws'
|
||||||
|
port: 3035
|
||||||
hmr: false
|
hmr: false
|
||||||
# Inline should be set to true if using HMR
|
# Inline should be set to true if using HMR
|
||||||
inline: true
|
inline: true
|
||||||
overlay: true
|
client:
|
||||||
compress: true
|
overlay: true
|
||||||
disable_host_check: true
|
open: true
|
||||||
use_local_ip: false
|
allowedHosts: 'all'
|
||||||
quiet: false
|
|
||||||
headers:
|
headers:
|
||||||
'Access-Control-Allow-Origin': '*'
|
'Access-Control-Allow-Origin': '*'
|
||||||
watch_options:
|
watch_options:
|
||||||
|
|||||||
18
package.json
18
package.json
@@ -5,7 +5,7 @@
|
|||||||
"node": ">=16"
|
"node": ">=16"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "cross-env NODE_ENV=development webpack-dev-server --config config/webpack/development.js",
|
"dev": "cross-env NODE_ENV=development webpack server --config config/webpack/development.js",
|
||||||
"build:development": "cross-env NODE_ENV=development webpack --config config/webpack/development.js",
|
"build:development": "cross-env NODE_ENV=development webpack --config config/webpack/development.js",
|
||||||
"build:production": "cross-env NODE_ENV=production webpack --config config/webpack/production.js",
|
"build:production": "cross-env NODE_ENV=production webpack --config config/webpack/production.js",
|
||||||
"build": "cross-env NODE_ENV=production webpack --config config/webpack/production.js",
|
"build": "cross-env NODE_ENV=production webpack --config config/webpack/production.js",
|
||||||
@@ -135,16 +135,16 @@
|
|||||||
"stacktrace-js": "^2.0.2",
|
"stacktrace-js": "^2.0.2",
|
||||||
"stringz": "^2.1.0",
|
"stringz": "^2.1.0",
|
||||||
"substring-trie": "^1.0.2",
|
"substring-trie": "^1.0.2",
|
||||||
"terser-webpack-plugin": "^4.2.3",
|
"terser-webpack-plugin": "^5.0.0",
|
||||||
"tesseract.js": "^2.1.5",
|
"tesseract.js": "^2.1.5",
|
||||||
"tiny-queue": "^0.2.1",
|
"tiny-queue": "^0.2.1",
|
||||||
"twitter-text": "3.1.0",
|
"twitter-text": "3.1.0",
|
||||||
"uuid": "^9.0.0",
|
"uuid": "^9.0.0",
|
||||||
"webpack": "^4.47.0",
|
"webpack": "^5.102.1",
|
||||||
"webpack-assets-manifest": "^4.0.6",
|
"webpack-assets-manifest": "^5.1.4",
|
||||||
"webpack-bundle-analyzer": "^4.8.0",
|
"webpack-bundle-analyzer": "^4.10.2",
|
||||||
"webpack-cli": "^3.3.12",
|
"webpack-cli": "^4.10.0",
|
||||||
"webpack-merge": "^5.9.0",
|
"webpack-merge": "^6.0.1",
|
||||||
"wicg-inert": "^3.1.2",
|
"wicg-inert": "^3.1.2",
|
||||||
"workbox-expiration": "^7.0.0",
|
"workbox-expiration": "^7.0.0",
|
||||||
"workbox-precaching": "^7.0.0",
|
"workbox-precaching": "^7.0.0",
|
||||||
@@ -188,7 +188,7 @@
|
|||||||
"@types/redux-immutable": "^4.0.3",
|
"@types/redux-immutable": "^4.0.3",
|
||||||
"@types/requestidlecallback": "^0.3.5",
|
"@types/requestidlecallback": "^0.3.5",
|
||||||
"@types/uuid": "^9.0.0",
|
"@types/uuid": "^9.0.0",
|
||||||
"@types/webpack": "^4.41.33",
|
"@types/webpack": "^5.28.5",
|
||||||
"@types/yargs": "^17.0.24",
|
"@types/yargs": "^17.0.24",
|
||||||
"@typescript-eslint/eslint-plugin": "^6.0.0",
|
"@typescript-eslint/eslint-plugin": "^6.0.0",
|
||||||
"@typescript-eslint/parser": "^6.0.0",
|
"@typescript-eslint/parser": "^6.0.0",
|
||||||
@@ -213,7 +213,7 @@
|
|||||||
"stylelint": "^15.10.1",
|
"stylelint": "^15.10.1",
|
||||||
"stylelint-config-standard-scss": "^11.0.0",
|
"stylelint-config-standard-scss": "^11.0.0",
|
||||||
"typescript": "^5.0.4",
|
"typescript": "^5.0.4",
|
||||||
"webpack-dev-server": "^3.11.3",
|
"webpack-dev-server": "^4.15.2",
|
||||||
"yargs": "^17.7.2"
|
"yargs": "^17.7.2"
|
||||||
},
|
},
|
||||||
"resolutions": {
|
"resolutions": {
|
||||||
|
|||||||
Reference in New Issue
Block a user