rspack
rspack copied to clipboard
[Feature] Should not generate facade `.js` files for CSS chunks
System Info
System: OS: Windows 10 10.0.19045 CPU: (12) x64 Intel(R) Core(TM) i7 Memory: 20.73 GB / 31.91 GB Binaries: Node: 18.12.0 - C:\Program Files\n npm: 9.2.0 - C:\Program Files\node Browsers: Edge: Spartan (44.19041.1266.0), C Internet Explorer: 11.0.19041.1566
Details
- Upgraded to 0.2.3
- Read documentation around
output.filenameno longer supporting[ext] - Created appropriate output values
filename,cssFilename, etc. - Bundle now creates an empty js file when I bundle css files using builtin sass loader
Reproduce link
No response
Reproduce Steps
Bundle sass files using 0.2.3
Thanks for reporting. I'd like to take a look at this. Please provide a reproduction repo using https://github.com/web-infra-dev/rspack-repro.
@hyf0 https://github.com/ICJR/rspack-repro
I noticed the empty js file is kept whenever I use the dynamic filename variables. I was using [contenthash] for my own project but this repo uses [name] and it runs into the same issue. ( webpack 5+ requires webpack-remove-empty-scripts to remove empty scripts.
Side question: In the previous version of rspack if I used [contenthash][ext] it would bundle using the entry path + content hash + extension. Is there a method to easily replicate that in the latest version?
Side question: In the previous version of rspack if I used [contenthash][ext] it would bundle using the entry path + content hash + extension. Is there a method to easily replicate that in the latest version?
See details at https://www.rspack.dev/blog/announcing-0.2.html#breaking-changes and https://github.com/web-infra-dev/rspack/issues/3270.
Is this file the empty file that you refer to?
If it is, the js file is generated expectedly under the current CSS implementation of Rspack.
Webpack won't emit the js file. It's a known difference and we plan to align with Webpack in the future.
That's the correct file, is my only option to revert to the older rspack version in the meantime?
That's the correct file, is my only option to revert to the older rspack version in the meantime?
I'm not sure how the old version behaves. But the current behavior is expected and correct.
My suggestion is to use the current version. It's not a bug.
I won't close this issue now. As I said before, we will align our CSS implementation with Webpack5 in the near future, then it will solve this issue.
This issue has been automatically marked as stale because it has not had recent activity. If this issue is still affecting you, please leave any comment (for example, "bump"). We are sorry that we haven't been able to prioritize it yet. If you have any new additional information, please include it with your comment!
@hyf0 is this fixed?
@hyf0 is this fixed?
This is a alignment feature rather than a bug. The alignment hasn't been made.
This issue has been automatically marked as stale because it has not had recent activity. If this issue is still affecting you, please leave any comment (for example, "bump"). We are sorry that we haven't been able to prioritize it yet. If you have any new additional information, please include it with your comment!
This issue has been automatically marked as stale because it has not had recent activity. If this issue is still affecting you, please leave any comment (for example, "bump"). We are sorry that we haven't been able to prioritize it yet. If you have any new additional information, please include it with your comment!
I would also like to have this alignment.
Duplicated with https://github.com/web-infra-dev/rspack/issues/5096, so I will close this issue, please discuess there
I fail to see how this is a duplicate with #5096, especially since rspack has switched to another CSS plugin in the meantime.
Could this be reopened?
Yes, this issue should reopen as webpack and Rspack both switch to new algorithm to deal with css since #8534. And we are trying to solve this
This issue has been automatically marked as stale because it has not had recent activity. If this issue is still affecting you, please leave any comment (for example, "bump"). We are sorry that we haven't been able to prioritize it yet. If you have any new additional information, please include it with your comment!
bump
bump