docusaurus
docusaurus copied to clipboard
feat: migrate webpack file-loader to asset modules
Breaking changes
-
require("./img/image.png").default
becomesrequire("./img/image.png")
Motivation
url-loader and file-loader are going to be deprecated in favor of asset modules
This is an attempt to migrate to asset modules.
Some initial problems encountered:
- https://github.com/facebook/docusaurus/commit/2f21d306bdd4d286cc5d25c81adaea2fc77f0474
- https://github.com/webpack/webpack/issues/12900
cc @alexander-akait
Have you read the Contributing Guidelines on pull requests?
yes
Test Plan
preview
Related PRs
Follow-up of https://github.com/facebook/docusaurus/pull/4089
[V1]
Built with commit 645bf67b5021b76ea5e772f75d21f8bdb2bdb689
https://deploy-preview-4708--docusaurus-1.netlify.app
Note for self, upgrade to css-loader 6 as part of this PR (see also https://github.com/facebook/docusaurus/pull/6424)