Conversation
Applies the remaining steps from the official webpack 5 migration guide (https://webpack.js.org/migrate/5/): - output.library + output.libraryTarget -> output.library object (name/type) in webpack.config.base.js - Replace deprecated file-loader and raw-loader rules with webpack 5 built-in Asset Modules (asset/resource, asset/source) - Upgrade webpack-cli 4 -> 5 (latest compatible with our webpack-dev-server 4 setup) and drop the raw-loader devDependency - create-spectacle: generated webpack configs use Asset Modules and generated package.json drops file-loader, bumps webpack-cli to ^5
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🦋 Changeset detectedLatest commit: dd1458f The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Completes the webpack 4 → 5 migration for this repo following the official migration guide.
Closes #1368
Closes #1338
Context: The
webpackversion in this repo was already bumped to 5.x over time (5.68.0 in #1087-era work, since bumped by dependabot to 5.111.1), but the guide's configuration-migration steps were never applied — our webpack configs and thecreate-spectaclegenerator still emitted webpack 4 idioms. This PR applies the remaining steps from the guide's "Clean up configuration" section:output.library/output.libraryTarget→output.libraryobject ({ name, type })webpack.config.base.jsfile-loaderwith Asset Modules (type: 'asset/resource')webpack.config.base.js,create-spectaclewebpack templateraw-loaderwith Asset Modules (type: 'asset/source')examples/md/webpack.config.js,create-spectaclewebpack templatewebpack-clito the latest version^4.10.0→^5.1.4(root + generated projects)raw-loaderfrom root devDependencies; dropfile-loaderfrom generatedpackage.jsonNotes:
webpack-cliis pinned to^5.1.4(not the newer 6/7 majors) because those integrate the dev-server CLI and expectwebpack-dev-server5+, while this repo is on dev-server 4 (a separate dependabot bump to 5.2.6 is already pending).webpack-cli@5is the latest release designed purely for webpack 5 builds.create-spectaclegenerator previously emitted a webpack config referencingraw-loaderwithout listing it in the generatedpackage.jsondevDependencies — generated markdown decks could not build. Asset Modules need no loader package, which fixes this and removesfile-loaderfrom generated deps entirely.ProvidePlugin(process/browser) and all other config options were checked against the guide; no other outdated options ([hash],optimization.*renames,Rule.query/Rule.loaders,node.fs,IgnorePluginregexp, etc.) are in use.Type of Change
How Has This Been Tested?
js,md,mdx,typescript) compile successfully before and after; output bundles are equivalent (themdexample inlinesslides.mdas the identical string viaasset/source).node --trace-deprecationbuilds produce zero deprecation warnings (guide: "Make sure your build has no errors or warnings").webpack.validate()confirmswebpack.config.base.js(newoutput.libraryobject form) and the generated configs pass webpack 5 schema validation.asset/resourcerule (emits a content-hashed asset), since no example currently imports images.tsxandmddecks viacreate-spectacleCLI and built both successfully with webpack 5.111.1 / webpack-cli 5 (markdown content inlines correctly; only benign bundle-size hints in production mode).pnpm run --filter ./packages/create-spectacle test— 4/4 pass.pnpm run --filter ./packages/spectacle test— 115/115 pass (18 suites).types:checkall pass for the touched workspaces.Checklist