GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat: support array values for devtool option by hai-x · Pull Request #20191 · webpack/webpack

Conversation

@hai-x

@hai-x hai-x commented Nov 29, 2025 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

Summary

What kind of change does this PR introduce?

Support multiple types for options.devtool to improve integration with native CSS modules.

Note that when options.devtool is defined as an array, accessing options.devtool will still return a string. This behavior is preserved intentionally for backward compatibility for some plugins (e.g. options.devtool === "eval", typeof options.devtool === "string").

Did you add tests for your changes?

Yes

Does this PR introduce a breaking change?

No

If relevant, what needs to be documented once your changes are merged or what have you already documented?

devtool and experiments.css

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@changeset-bot

changeset-bot Bot commented Nov 29, 2025 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 4f2bf33

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
webpack Minor

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions

github-actions Bot commented Nov 29, 2025 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

This PR is packaged and the instant preview is available (b0e0e4c).

Install it locally:

  • npm
npm i -D webpack@https://pkg.pr.new/webpack@b0e0e4c
  • yarn
yarn add -D webpack@https://pkg.pr.new/webpack@b0e0e4c
  • pnpm
pnpm add -D webpack@https://pkg.pr.new/webpack@b0e0e4c
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@codspeed

codspeed Bot commented Nov 29, 2025 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

CodSpeed Performance Report

Merging #20191 will not alter performance

Comparing feat-css-devtool (4f2bf33) with main (3ae1004)

Summary

✅ 72 untouched

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

alexander-akait
alexander-akait reviewed Dec 1, 2025
View reviewed changes

@alexander-akait alexander-akait left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, let's add a test cases

Another problem - we should allow to set CSS source map values by user too, like hidden-source-map and etc

So I am think about to allow devtool accepts arrays, but because we can't change devtool type for webpack@5, let's add an internal option (devtoolByTypes, maybe better name in normalization) and store source map values for types there, i.e.

devtool can be string | { test: Rule, type: "source-map" | "hidden-source-map" | "etc" }, but then in normalization we found a JS value and set it to devtool (to keep devtool a string), technically we can just take the first value of an array (but feel free to think here)

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

hai-x reacted with heart emoji
All reactions
  • ❤️ 1 reaction
@hai-x
hai-x force-pushed the feat-css-devtool branch from cb94128 to 4ab8b46 Compare December 11, 2025 16:30
hai-x
hai-x commented Dec 11, 2025
View reviewed changes
Comment thread lib/WebpackOptionsApply.js
: /\.((c|m)?js|css)($|\?)/i;

new Plugin({
test: evalWrapped ? undefined : assetExt,

@hai-x hai-x Dec 11, 2025

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In EvalSourceMapDevToolPlugin, test is for module resources rather than asset file. To avoid breaking logic for .ts modules, we leave it as undefined.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

alexander-akait reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
@hai-x
hai-x force-pushed the feat-css-devtool branch from 57b0fae to 8f82a04 Compare December 11, 2025 18:28
@hai-x
hai-x marked this pull request as ready for review December 11, 2025 18:30
@hai-x
hai-x force-pushed the feat-css-devtool branch 7 times, most recently from e188e1c to 222c667 Compare December 15, 2025 17:57
alexander-akait
alexander-akait reviewed Dec 18, 2025
View reviewed changes
Comment thread test/configCases/source-map/devtools-customize/webpack.config.js Outdated
css: true,
outputModule: true
},
devtool: "source-map",

@alexander-akait alexander-akait Dec 18, 2025

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hai-x Let's add a test case where we set it to devtool: [...]

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

hai-x reacted with heart emoji
All reactions
  • ❤️ 1 reaction

@hai-x hai-x Dec 18, 2025

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for review. Let we re-use this test case here and just change the value to devtool: [...].

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

alexander-akait reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
@alexander-akait

alexander-akait commented Dec 18, 2025

Copy link
Copy Markdown
Member

@hai-x Also let's rebase and we can merge 👍

hai-x reacted with heart emoji
All reactions
  • ❤️ 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@hai-x hai-x changed the title feat: support sourcemap for experiments css when using eval devtool feat: support array values for devtool option Dec 18, 2025
@hai-x
hai-x force-pushed the feat-css-devtool branch 2 times, most recently from 3d7f4ad to 96dfa25 Compare December 18, 2025 17:08
@alexander-akait

alexander-akait commented Dec 18, 2025

Copy link
Copy Markdown
Member

@hai-x let's fix failed test, just need to update snapshots 😄

hai-x reacted with heart emoji
All reactions
  • ❤️ 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@hai-x
hai-x force-pushed the feat-css-devtool branch from 96dfa25 to 08a8d6b Compare December 20, 2025 07:37
@hai-x
feat: support array values for devtool option
9b1c728
@hai-x
hai-x force-pushed the feat-css-devtool branch from 08a8d6b to 9b1c728 Compare December 20, 2025 18:29
alexander-akait
alexander-akait approved these changes Dec 21, 2025
View reviewed changes
@alexander-akait
Create thirty-ears-join.md
4f2bf33
@alexander-akait
alexander-akait merged commit b0e0e4c into main Dec 21, 2025
@alexander-akait
alexander-akait deleted the feat-css-devtool branch December 21, 2025 21:12
@alexander-akait

alexander-akait commented Dec 21, 2025

Copy link
Copy Markdown
Member

Thanks

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions github-actions Bot mentioned this pull request Dec 22, 2025
chore(release): new release #20256
Merged
This was referenced Dec 22, 2025
chore(release): new release SimenB/webpack#353
Open
chore(release): new release LadyK-21/webpack#145
Open
chore(release): new release noritaka1166/webpack#3
Open
chore(release): new release moushicheng/webpack#242
Open
chore(release): new release ehtick/webpack#333
Open
chore(release): new release MaxMood96/webpack#459
Open
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@alexander-akait alexander-akait alexander-akait approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@hai-x @alexander-akait
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.