Skip to content

chore(v2): Update webpack-related dependencies, pre-work to migrate to Webpack 5#4081

Merged
slorber merged 4 commits into
facebook:masterfrom
RDIL:init-webpack-5r
Jan 21, 2021
Merged

chore(v2): Update webpack-related dependencies, pre-work to migrate to Webpack 5#4081
slorber merged 4 commits into
facebook:masterfrom
RDIL:init-webpack-5r

Conversation

@RDIL

@RDIL RDIL commented Jan 20, 2021

Copy link
Copy Markdown
Contributor

Motivation

Begin to implement #4027 by updating the webpack plugins & related code.

Notes for webpack 5 upgrade:

  • mini-css-extract-plugin on latest BREAKS SEARCH stuff in the production build
  • html-webpack-plugin will need an update
  • null-loader should be removed
  • terser-webpack-plugin on latest just doesn't work

Have you read the Contributing Guidelines on pull requests?

Yes.

Test Plan

I've confirmed it still works just fine on the current webpack version (v4).

Related PRs

n/a

@facebook-github-bot facebook-github-bot added the CLA Signed Signed Facebook CLA label Jan 20, 2021
@netlify

netlify Bot commented Jan 20, 2021

Copy link
Copy Markdown

@netlify

netlify Bot commented Jan 20, 2021

Copy link
Copy Markdown

Deploy preview for docusaurus-2 ready!

Built without sensitive environment variables with commit 1387533

https://deploy-preview-4081--docusaurus-2.netlify.app

@github-actions

github-actions Bot commented Jan 20, 2021

Copy link
Copy Markdown

Size Change: -2 B (0%)

Total Size: 27.1 kB

ℹ️ View Unchanged
Filename Size Change
website/build/blog/2017/12/14/introducing-docusaurus/index.html 20.9 kB -2 B (0%)
website/build/docs/introduction/index.html 180 B 0 B
website/build/index.html 6.02 kB 0 B

compressed-size-action

Signed-off-by: Reece Dunham <me@rdil.rocks>
Comment thread packages/docusaurus/src/webpack/utils.ts
Comment thread packages/docusaurus/src/webpack/base.ts
Comment thread packages/docusaurus-utils/package.json
@github-actions

github-actions Bot commented Jan 20, 2021

Copy link
Copy Markdown

⚡️ Lighthouse report for the changes in this PR:

Category Score
🟢 Performance 90
🟢 Accessibility 99
🟢 Best practices 100
🟢 SEO 100
🟢 PWA 95

Lighthouse ran on https://deploy-preview-4081--docusaurus-2.netlify.app/classic/

@RDIL RDIL requested review from lex111 and slorber as code owners January 21, 2021 00:58
@RDIL RDIL marked this pull request as ready for review January 21, 2021 00:58
@semoal

semoal commented Jan 21, 2021

Copy link
Copy Markdown
Contributor

About terser: If you are using webpack v5 or above you do not need to install this plugin. Webpack v5 comes with the latest terser-webpack-plugin out of the box. Using Webpack v4

About html-webpack-plugin: actually you have to install @next version to make it compatible with webpack 5

@RDIL

RDIL commented Jan 21, 2021

Copy link
Copy Markdown
Contributor Author

About terser: If you are using webpack v5 or above you do not need to install this plugin. Webpack v5 comes with the latest terser-webpack-plugin out of the box. Using Webpack v4

About html-webpack-plugin: actually you have to install @next version to make it compatible with webpack 5

Yes, but this PR is just to bump up the non-critical dependencies to make the actual webpack 5 PR smaller.

@slorber

slorber commented Jan 21, 2021

Copy link
Copy Markdown
Collaborator

Ah I see, that's why the deploy preview looks fine to me 😅

Thanks for your work, will review it soon

@slorber

slorber commented Jan 21, 2021

Copy link
Copy Markdown
Collaborator

LGTM didn't see any issue

@slorber slorber added the pr: maintenance This PR does not produce any behavior differences to end users when upgrading. label Jan 21, 2021
@slorber slorber changed the title Update webpack-related dependencies chore(v2): Update webpack-related dependencies, pre-work to migrate to Webpack 5 Jan 21, 2021
@slorber slorber merged commit a36abd8 into facebook:master Jan 21, 2021
@RDIL RDIL deleted the init-webpack-5r branch January 21, 2021 16:23
@lex111 lex111 added this to the v2.0.0-alpha.71 milestone Mar 1, 2021
mrizwanashiq pushed a commit to mrizwanashiq/docusaurus that referenced this pull request Jun 25, 2026
…o Webpack 5 (facebook#4081)

* Rebase

* (Post)CSS-Loader fixes

Signed-off-by: Reece Dunham <me@rdil.rocks>

* HMM, mini-css-extract-plugin is being naughty

* Restore HMR
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed Signed Facebook CLA pr: maintenance This PR does not produce any behavior differences to end users when upgrading.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants