Unverified Commit de566e5d authored by Dorian Johnson's avatar Dorian Johnson Committed by GitHub

chore: build: upgrade webpack from 4 to 5 (#770)

* app node_modules: upgrade webpack to 4->5
Signed-off-by: 's avatarDorian Johnson <2020@dorianj.net>

* package.json: install path-browserify

Needed by react-markdown as of 5.0.2
Signed-off-by: 's avatarDorian Johnson <2020@dorianj.net>

* webpack: use polyfill for path
Signed-off-by: 's avatarDorian Johnson <2020@dorianj.net>

* webpack: add hack to make old react-bootstrap work
Signed-off-by: 's avatarDorian Johnson <2020@dorianj.net>

* package.json: upgrade html-webpack-plugin 4 -> 4.5.0
Signed-off-by: 's avatarDorian Johnson <2020@dorianj.net>

* package.json: upgrade mini-css-extract-plugin 0.10 -> 0.12

Fixes many webpack deprecation warnings.
Signed-off-by: 's avatarDorian Johnson <2020@dorianj.net>

* webpack: fix deprecation warning in moduleIds optimization
Signed-off-by: 's avatarDorian Johnson <2020@dorianj.net>

* webpack: link hacky behavior to ticket

https://github.com/amundsen-io/amundsen/issues/818Signed-off-by: 's avatarDorian Johnson <2020@dorianj.net>
parent 23964d1c
......@@ -93,12 +93,12 @@
"eslint-plugin-react": "^7.20.5",
"eslint-plugin-react-hooks": "^4.0.4",
"find-unused-sass-variables": "^2.0.0",
"html-webpack-plugin": "4.3.0",
"html-webpack-plugin": "^4.5.0",
"husky": "^4.3.0",
"jest": "^26.6.0",
"jest-css-modules": "^2.1.0",
"lint-staged": "^10.2.11",
"mini-css-extract-plugin": "^0.10.0",
"mini-css-extract-plugin": "^0.12.0",
"moment-locales-webpack-plugin": "^1.2.0",
"node-sass": "^5.0.0",
"postcss": "^7.0.32",
......@@ -120,7 +120,7 @@
"tsconfig-paths": "^3.9.0",
"tslint": "^6.1.3",
"typescript": "^4.0.5",
"webpack": "^4.44.1",
"webpack": "^5.0.0-rc.6",
"webpack-bundle-analyzer": "^3.8.0",
"webpack-cli": "^3.3.11",
"webpack-merge": "^4.2.2",
......@@ -134,6 +134,7 @@
"form-serialize": "^0.7.2",
"jquery": "^3.5.0",
"moment-timezone": "^0.5.31",
"path-browserify": "^1.0.1",
"react": "^16.13.1",
"react-avatar": "^2.5.1",
"react-bootstrap": "^0.32.4",
......
......@@ -74,6 +74,10 @@ const config: webpack.Configuration = {
utils: PATHS.utils,
},
extensions: RESOLVED_EXTENSIONS,
fallback: {
// Needed by react-markdown as of 5.0.2
path: require.resolve('path-browserify'),
},
},
module: {
rules: [
......@@ -109,6 +113,15 @@ const config: webpack.Configuration = {
test: FONT_PATTERN,
use: 'file-loader',
},
// Hacky, required for react-bootstrap @ 0.33.1 - remove after upgrading,
// see: https://github.com/webpack/webpack/issues/11467
// Tracked at https://github.com/amundsen-io/amundsen/issues/818
{
test: /\.m?js$/,
resolve: {
fullySpecified: false,
},
},
],
},
plugins: [
......@@ -117,7 +130,7 @@ const config: webpack.Configuration = {
...htmlWebpackPluginConfig,
],
optimization: {
moduleIds: 'hashed',
moduleIds: 'deterministic',
splitChunks: {
cacheGroups: {
default: false,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment