Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
feat(v2): Webpack 5, PostCSS 8 (#4089)
* Initial webpack 5 work * It works on my machine (lol) * Committing a bit more work * It works - sorta * Update packages/docusaurus/package.json * at least fix prettier /shrug * making more progress. build should work now, css stuff is still a bit broken * Terser things Signed-off-by: Reece Dunham <[email protected]> * Working on things * Vendor webpack * Repair chunks, and tests * Rerun prettier * Re-add client prefetching * Update snapshots * Update snapshots * I hope this works * Remove redundant dev server code * relock * Trying to reduce memory usage and fix things * Dead code elim * Search bar works!!! * Prefetching should work again * lock * ts issue * Repair snapshot * Run prettier * Fix the CI for now * fix lint-prettier * clean-css works, now for the other one * Fix lockfile * Fixes prettier * Other css minification works!!! * Add clean-css options, fix webpack versions Signed-off-by: Reece Dunham <[email protected]> * Fix tests and several of the webpack loaders Signed-off-by: Reece Dunham <[email protected]> * Re-add support for simple css minifier * Update other related dependencies * Fix lockfile * Dev server fixups Signed-off-by: Reece Dunham <[email protected]> * Simplify css things * Update webpack, try with postcss 7 * Other cssnano repairs * fix lockfile * Clean up the babel preset * Fix lockfile * Bump RL SSR version * Fix the build errors * Lockfile fix * It works again * webpack 5 should close compiler after run * add proper webpack5 persistent caching config * upgrade webpack deps again * reduce build perf timeouts to avoid build time regressions * test if incremental build can run on netlify * netlify test * netlify test * netlify test * netlify test * netlify test * netlify test * netlify test * netlify test * netlify test * netlify test * netlify test * netlify test * netlify test * netlify test * netlify test * test * test * test * test * netlify test * netlify test * netlify test * netlify test * netlify test * netlify test * netlify test * netlify test * netlify test * netlify test * fix existsSync() calls * replace @ts-nocheck by a temporary Webpack type * replace @ts-nocheck by a temporary Webpack type * replace @ts-nocheck by a temporary Webpack type * migrate existing stats.warningsFilter to config.ignoreWarnings * remove stats from postBuild lifecycle data doc, as it is likely unused (we'll add it back if someone ask for it) * improve build.ts TS issues + move some sync code to async * cleanup TS of start.ts * fix TS error * fix TS issues * fix TS issues * fix ts error * netlify test * netlify test * netlify test * netlify test * netlify test * script cleanup * script cleanup * re-enable @typescript-eslint/ban-ts-comment * Deprecate getCacheLoader / getBabelLoader but keep retrocompatibility * useless TS * fix and comment gca(chunkName) prefetching function * remove deprecated mainTemplate.requireFn * temporarily use react-loadable-ssr-addon-v5-slorber until PR merged: #4089 * comment unsafeCache option * add explicit and more precise webpack targets * splitChunks, use new type: "css/mini-extract" as it seems recommended for webpack 5 * webpack error handling: - log error.details as documented - keep using react-dev-utils/formatWebpackMessages for now * fix webpack5 warnings for evalSourceMapMiddleware.js * typo * rename webpackHotDevClient * make all modifications of react-dev-utils explicit with a comment * revert LogPlugin adapter * loader-utils update * add useful share cache comment * add useful comments regarding the null-loader used in SSR for css files * upgrade webpack-merge in a retrocompatible way * use MiniCssExtractPlugin.emit false as recommended * use @docusaurus/responsive-loader * revert MiniCssExtractPlugin esModule: false change * add link to PR for custom CleanWebpackPlugin * pwa: add fallback to env variable or webpack 5 fails to build * upgrade to CssMinimizerPlugin 2.0 * only build en locale for windows tests * line breaks between errors * add useful comment * Fix e2e tests with Yarn2 not finding new init template dependencies * fix bad import * disable browserslist target as webpack already tries to use browserlists if a config is found, and it is a problem for existing sites * webpack5 TS fixes * fix getMinimizer order (even if it does not work yet) * update postcss to v8, fix cssnano minimizer errors * add NavbarItem position to types (useful for QuestDB site upgrade to Webpack5) * add webpack cache env variable to reduce risk of webpack 5 adoption Co-authored-by: slorber <[email protected]>
- Loading branch information
Showing
with
1,809 additions
and 1,575 deletions.
- +2 −2 .github/workflows/v2-build-time-perf.yml
- +1 −1 .github/workflows/v2-tests-windows.yml
- +3 −4 package.json
- +12 −9 packages/docusaurus-cssnano-preset/index.js
- +3 −3 packages/docusaurus-cssnano-preset/package.json
- +35 −37 packages/docusaurus-cssnano-preset/src/remove-overridden-custom-properties/index.js
- +6 −3 packages/docusaurus-init/templates/bootstrap/package.json
- +2 −3 packages/docusaurus-init/templates/bootstrap/src/pages/index.js
- +4 −1 packages/docusaurus-init/templates/classic/package.json
- +4 −1 packages/docusaurus-init/templates/facebook/package.json
- +2 −2 packages/docusaurus-mdx-loader/package.json
- +2 −2 packages/docusaurus-mdx-loader/src/index.js
- +1 −1 packages/docusaurus-mdx-loader/src/remark/transformImage/index.js
- +3 −3 packages/docusaurus-mdx-loader/src/remark/transformLinks/index.js
- +2 −2 packages/docusaurus-plugin-content-blog/package.json
- +4 −5 packages/docusaurus-plugin-content-blog/src/index.ts
- +11 −6 packages/docusaurus-plugin-content-blog/src/markdownLoader.ts
- +1 −1 packages/docusaurus-plugin-content-docs/package.json
- +1 −2 packages/docusaurus-plugin-content-docs/src/__tests__/index.test.ts
- +8 −12 packages/docusaurus-plugin-content-docs/src/index.ts
- +8 −4 packages/docusaurus-plugin-content-docs/src/markdown/index.ts
- +1 −2 packages/docusaurus-plugin-content-pages/package.json
- +4 −5 packages/docusaurus-plugin-content-pages/src/index.ts
- +7 −4 packages/docusaurus-plugin-content-pages/src/markdownLoader.ts
- +2 −2 packages/docusaurus-plugin-ideal-image/package.json
- +2 −3 packages/docusaurus-plugin-ideal-image/src/index.ts
- +3 −3 packages/docusaurus-plugin-pwa/package.json
- +3 −2 packages/docusaurus-plugin-pwa/src/index.js
- +2 −2 packages/docusaurus-theme-classic/package.json
- +18 −29 packages/docusaurus-theme-classic/src/index.ts
- +1 −0 packages/docusaurus-theme-common/src/utils/useThemeConfig.ts
- +2 −2 packages/docusaurus-types/package.json
- +20 −14 packages/docusaurus-types/src/index.d.ts
- +13 −15 packages/docusaurus/package.json
- +0 −6 packages/docusaurus/src/babel/preset.ts
- +1 −1 packages/docusaurus/src/client/serverEntry.js
- +15 −18 packages/docusaurus/src/commands/build.ts
- +3 −5 packages/docusaurus/src/commands/start.ts
- +4 −0 packages/docusaurus/src/constants.ts
- +1 −0 packages/docusaurus/src/server/index.ts
- +6 −0 packages/docusaurus/src/webpack/__tests__/base.test.ts
- +2 −2 packages/docusaurus/src/webpack/__tests__/client.test.ts
- +2 −2 packages/docusaurus/src/webpack/__tests__/server.test.ts
- +3 −7 packages/docusaurus/src/webpack/__tests__/utils.test.ts
- +44 −18 packages/docusaurus/src/webpack/base.ts
- +5 −5 packages/docusaurus/src/webpack/client.ts
- +14 −10 packages/docusaurus/src/webpack/plugins/ChunkAssetPlugin.ts
- +16 −114 packages/docusaurus/src/webpack/plugins/CleanWebpackPlugin.ts
- +0 −31 packages/docusaurus/src/webpack/plugins/LogPlugin.js
- +35 −0 packages/docusaurus/src/webpack/plugins/LogPlugin.ts
- +11 −0 packages/docusaurus/src/webpack/react-dev-utils-webpack5/README.md
- +57 −0 packages/docusaurus/src/webpack/react-dev-utils-webpack5/evalSourceMapMiddleware.js
- +138 −0 packages/docusaurus/src/webpack/react-dev-utils-webpack5/formatWebpackMessages.js
- +285 −0 packages/docusaurus/src/webpack/react-dev-utils-webpack5/webpackHotDevClient.js
- +2 −1 packages/docusaurus/src/webpack/server.ts
- +136 −125 packages/docusaurus/src/webpack/utils.ts
- +0 −1 packages/lqip-loader/package.json
- +1 −2 packages/lqip-loader/src/index.js
- +1 −0 tsconfig.json
- +1 −4 website/docs/lifecycle-apis.md
- +20 −8 website/netlify.toml
- +1 −0 website/package.json
- +812 −1,028 yarn.lock
Oops, something went wrong.

