eui
eui copied to clipboard
[Platform] Upgrade to webpack 5
Summary
To unblock bringing in the MDX loader, and as general house keeping, this upgrades webpack to v5 and brings a few other dependencies current.
- updated webpack & related dependencies to latest
- updated webpack.config.js
- updated react-docgen-typescript.js with new webpack dev server env variable
- updated prop-loader.js to build a fresh TS program when processing file changes, propagating those changes to props tables
- removed
file-loaderconfiguration, was present to handle importing font files which we no longer do. Still present in package.json as it is a peerDep for other loaders - updated src/themes/charts/webpack.config.js
- removed the
isProductionflag, was never run in that mode - tested generation of dist/eui_charts_theme.js , confirmed JSON object of new and old matches exactly
- removed the
Remaining before taking out of draft:
- [x] verify custom babel things are unchanged
- [x] react refresh works the same
- [x] double check dev server config
- [x] contentBase (confirmed this wasn't used, has been pointing at a non-existent dir)
- [x] disabledHostCheck (confirmed access over network still work with this removed)
- [x] hot (confirmed removal, setting to true is now the default)
- [x] double check loaders
- [x] cache loader
- [x] proptype loader
- [x] docgen loader
- [x] babel loader
- [x] css + sass loaders
- [x] styles-loader + css + postcss + sass loaders
- [x] file-loader
- [x] url-loader
- [x] raw-loader
- [x] double check a js error in the webpack config is properly reported, now that module.exports = Promise
- [x] verify src/themes/charts webpack usage works
- [x] verify cypress webpack usage works (including cypress 10 branch)
- [x] check in on the rebundle time
~### Checklist~
Preview documentation changes for this PR: https://eui.elastic.co/pr_6193/
Preview documentation changes for this PR: https://eui.elastic.co/pr_6193/
Preview documentation changes for this PR: https://eui.elastic.co/pr_6193/
Both eslint & the docker ci test build failing; initial look into the lint thing means maybe eslint needs a version bump too? It doesn't seem to be using webpack to resolve imports anymore. Docker may just need a new image with the new webpack version baked in
Preview documentation changes for this PR: https://eui.elastic.co/pr_6193/
Preview documentation changes for this PR: https://eui.elastic.co/pr_6193/
Mind merging main? I want to see CI run times without the flakiness we've been having lately.
Preview documentation changes for this PR: https://eui.elastic.co/pr_6193/
@thompsongl re-ran the build based on main
Preview documentation changes for this PR: https://eui.elastic.co/pr_6193/
merged main to resolve a yarn.lock conflict, will merge on green
Preview documentation changes for this PR: https://eui.elastic.co/pr_6193/