-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Fix css exports in package json #9162
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
|
This preview will be available after the AzureCI is passed. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #9162 +/- ##
=======================================
Coverage 90.86% 90.86%
=======================================
Files 574 574
Lines 23261 23261
Branches 4639 4639
=======================================
Hits 21135 21135
Misses 1393 1393
Partials 733 733 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Nicoss54
left a comment
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.
LGTM, @Laffery could you confirm ?
|
It may be a bigger issue, it seems I cannot import the individual component styles either. For now I have a workaround, will read a bit more about style exports to see what is wrong. I think this occurs in combination with the new Angular application builder and scss as styles. How do you do your import ?? if you did it like this @import 'relative_path_to_node_modules/node_modules/ng-zorro/button/style/index.min.cssit will not work ? |
|
Import with the node_modules path included does work. @import "../node_modules/ng-zorro-antd/style/index.min.css";But with esbuild, that Angular application builder uses, it should work like this. Unfortunately the compiler complains about the styles not being exported. @import "ng-zorro-antd/style/index.min.css"; |
|
@richard-elastique i tried to reproduce you problem, but it work on my side, could you give us a reproduction link please ? |
|
Having the less and style exports separate seems to fix the problem. |
|
@Laffery @HyperLife1119 could you take a look ? |
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.
Pull request overview
This PR fixes the CSS exports configuration in package.json to properly expose the index.min.css files for all components. Previously, the exports configuration only included LESS file mappings for component styles. This change splits the single wildcard export for each component into separate entries for LESS and CSS files, and adds a new root-level wildcard export for CSS files.
Key changes:
- Split each component's style export from a single wildcard pattern into separate LESS and CSS exports
- Added root-level
./*.cssexport mapping - Added watermark component style exports
| "less": "./affix/style/*.less" | ||
| }, | ||
| "./affix/style/*.css": { | ||
| "style": "./affix/style/index.min.css" |
Copilot
AI
Dec 1, 2025
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.
The CSS wildcard pattern ./affix/style/*.css maps to a specific file ./affix/style/index.min.css instead of preserving the wildcard. This means consumers can request any CSS file path matching the pattern (e.g., ./affix/style/custom.css), but they will always receive index.min.css. This is inconsistent with the LESS export pattern on line 81 which correctly preserves the wildcard with ./affix/style/*.less. Consider changing the style value to ./affix/style/*.css to allow resolution of any CSS file, or update the pattern to be more specific like ./affix/style/index*.css to clarify that only index files are available.
| "style": "./affix/style/index.min.css" | |
| "style": "./affix/style/*.css" |
| "./*.css": { | ||
| "style": "./*.css" | ||
| }, |
Copilot
AI
Dec 1, 2025
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.
The root-level CSS export pattern ./*.css correctly preserves the wildcard (unlike the component-specific patterns), which creates inconsistency in the exports configuration. If the intention is to allow access to any root-level CSS file, this is correct. However, this inconsistency with component-level CSS exports (which map to specific index.min.css files) may confuse consumers. Consider documenting this behavior or making the patterns consistent throughout.
| "./*.css": { | |
| "style": "./*.css" | |
| }, | |
| // Removed wildcard root-level CSS export for consistency with component-level exports |
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
#7928 add support for style exports in the package.json. But the index.min.css file is not exported.

Issue Number: N/A
What is the new behavior?
Add the index.min.css file as exported in the same way as the index.less
Does this PR introduce a breaking change?