-
Notifications
You must be signed in to change notification settings - Fork 291
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Upgrade webpack from v4 to v5 #734
Conversation
Bumps [webpack](https://github.com/webpack/webpack) from 4.46.0 to 5.94.0. - [Release notes](https://github.com/webpack/webpack/releases) - [Commits](webpack/webpack@v4.46.0...v5.94.0) --- updated-dependencies: - dependency-name: webpack dependency-type: direct:development ... Signed-off-by: dependabot[bot] <[email protected]>
Wiz Scan Summary
To detect these findings earlier in the dev lifecycle, try using Wiz Code VS Code Extension. |
@@ -43,13 +43,11 @@ | |||
"babel-loader": "^8.2.2", | |||
"babel-plugin-rewire": "1.2.0", | |||
"babel-plugin-syntax-trailing-function-commas": "^6.8.0", | |||
"bundle-loader": "0.5.6", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unused
"css-loader": "^5.2.7", | ||
"eslint": "7", | ||
"eslint-config-prettier": "6.10.0", | ||
"except": "^0.1.3", | ||
"faker": "^5.5.3", | ||
"file-loader": "4.2.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
file-loader
is deprecated. Webpack recommends to use asset modules instead.
See https://v4.webpack.js.org/loaders/file-loader/
@@ -77,8 +75,7 @@ | |||
"rollup-plugin-terser": "^7.0.2", | |||
"style-loader": "1.0.0", | |||
"terser-webpack-plugin": "4.2.3", | |||
"url-loader": "2.1.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
url-loader
is also deprecated in favor of asset modules.
@@ -14,7 +15,7 @@ module.exports = { | |||
|
|||
output: { | |||
path: path.resolve(__dirname, '../__site__/'), | |||
filename: isDev ? '[name].js' : '[name]-[hash].js', | |||
filename: isDev ? '[name].js' : '[name]-[contentHash].js', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Webpack recommends using contentHash
instead of hash
.
When using [hash] placeholder in webpack configuration, consider changing it to [contenthash]. It is not the same, but proven to be more effective.
@@ -24,10 +25,15 @@ module.exports = { | |||
rules: [ | |||
{ | |||
test: /\.md$/, | |||
loader: [ | |||
'html-loader?{"minimize":false}', | |||
use: [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Older syntax no longer supported in webpack v5
@@ -74,6 +82,9 @@ module.exports = { | |||
'fixed-data-table-2/css': path.join(__dirname, '../src/css'), | |||
'fixed-data-table-2': path.join(__dirname, '../src/index'), | |||
}, | |||
fallback: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The core node url
package is no longer included by webpack by default.
But it doesn't look like we need them, so I'm setting resolve.fallback.url
to false.
@@ -12,7 +13,9 @@ module.exports = { | |||
output: { | |||
path: path.resolve(__dirname, '../__site_prerender__/'), | |||
filename: 'renderPath.js', | |||
libraryTarget: 'commonjs2', | |||
library: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
output.libraryTarget
changed to output.library.type
lgtm |
Primary: @AmanGupta2708 or @karry08
JIRA: https://schrodinger.atlassian.net/browse/LDTOOLS-233
Description
This upgrades webpack from v4 to v5.
I followed webpack's docs for the migration.
Motivation and Context
Fixes #730.
How Has This Been Tested?
Tested with local examples.
TODO: Test on sandbox.
Types of changes
Checklist: