-
-
Notifications
You must be signed in to change notification settings - Fork 6.2k
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
fix: css-post/emitFile uses chunkName #9485
Conversation
I'm not sure if this fixes a bug, but only makes the chunk name look nicer? If there's a bug fix, can your provide tests for this? |
@bluwy This likely fixes an unintentional (?) v3 change in behavior detailed in #9877. Are you able to confirm that change in behavior was indeed unintentional? If so, then if the submitter of this PR isn't still monitoring it (it's been a while) I'll gladly submit another PR with tests added. I've had to add manual logic to a lot of Vue apps working around this issue that I'd love to remove. |
Example here : https://github.com/yzydeveloper/vite-css-post-plugin-demo |
I didn't know this PR fixes #9877 as it wasn't stated in the description, let me check the issue again. I did look at https://github.com/yzydeveloper/vite-css-post-plugin-demo but it wasn't clear what's wrong before. |
I expect to get: dist/assets/css/theme-default.e644798f.css But actually get |
The original logic is to directly take the module path as the file name to intercept and generate the asset name. In my example, the file name is index.less. By specifying the input, I expect to output the asset name according to the input instead of using the source file name to generate. |
@bluwy Please see my reply #9485 (comment) |
@bluwy I don't know if this PR fixes it, but this bug does not only make chunk name ugly (see #9877 (comment)). |
Description
css-post/emitFile/fileName uses chunkName
Additional context
I think the file name when emitFIle must be chunkName, it can keep the uniqueness of the output asset name. For specific examples, see vite-css-post-plugin-demo
This example uses assets as input, in order to output a different style theme file
What is the purpose of this pull request?
Before submitting the PR, please make sure you do the following
fixes #123
).