feat: support named exports with any characters#1057
Closed
laverdet wants to merge 1 commit intowebpack:masterfrom
Closed
feat: support named exports with any characters#1057laverdet wants to merge 1 commit intowebpack:masterfrom
laverdet wants to merge 1 commit intowebpack:masterfrom
Conversation
A proposed change to `css-loader` will allow named exports to be any string, regardless of whether or not it is a valid identifier. The code generation in this project assumes that all exports will be a valid identifier, so the generation stage has been updated to take this into account.
|
|
This was referenced Oct 24, 2023
Author
|
This is part of a series of pull requests which adds better ecosystem support for exporting original, non-mangled, CSS names as named exports. webpack/css-loader#1549 Due to the optimization bailout condition [webpack/webpack#17626] with JSON default exports consumed by hoistable functions, original non-minified CSS module class names can be found in the minified source code. |
This was referenced Jan 31, 2024
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.
A proposed change to
css-loaderwill allow named exports to be any string, regardless of whether or not it is a valid identifier. The code generation in this project assumes that all exports will be a valid identifier, so the generation stage has been updated to take this into account.This PR contains a:
Motivation / Use-Case
When using the new "asIs" named exports feature I submitted in webpack/css-loader#1549, this module will produce incorrect output since the export names may not be valid local identifiers.
Breaking Changes
Requires support for
export { local as "string literal" }syntax which is not supported until nodejs v16.x.Additional Info
Named exports resolve the Terser bailout condition described in webpack/webpack#17626 but reduce "grepability" of your code.