Skip to content
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

Should not generate facade .js files for CSS chunks #3608

Open
Tracked by #3449
ICJR opened this issue Jun 21, 2023 · 10 comments
Open
Tracked by #3449

Should not generate facade .js files for CSS chunks #3608

ICJR opened this issue Jun 21, 2023 · 10 comments
Assignees
Labels
feat New feature or request

Comments

@ICJR
Copy link

ICJR commented Jun 21, 2023

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.filename no 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

@ICJR ICJR added bug Something isn't working pending triage The issue/PR is currently untouched. labels Jun 21, 2023
@hyf0 hyf0 added need reproduction and removed pending triage The issue/PR is currently untouched. labels Jun 22, 2023
@hyf0
Copy link
Collaborator

hyf0 commented Jun 22, 2023

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.

@ICJR
Copy link
Author

ICJR commented Jun 22, 2023

@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?

@hyf0
Copy link
Collaborator

hyf0 commented Jun 22, 2023

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 #3270.

@hyf0
Copy link
Collaborator

hyf0 commented Jun 22, 2023

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.

@ICJR
Copy link
Author

ICJR commented Jun 23, 2023

That's the correct file, is my only option to revert to the older rspack version in the meantime?

@hyf0
Copy link
Collaborator

hyf0 commented Jun 24, 2023

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.

@hyf0 hyf0 added feat New feature or request p3-nice-to-have and removed bug Something isn't working need reproduction labels Jun 24, 2023
@hyf0 hyf0 changed the title Bundling sass files generates an empty js file after upgrade to 0.2.3 Should not generate facade .js files for CSS chunks Jun 24, 2023
@stale
Copy link

stale bot commented Aug 23, 2023

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!

@stale stale bot added the stale label Aug 23, 2023
@hardfist
Copy link
Contributor

@hyf0 is this fixed?

@hyf0
Copy link
Collaborator

hyf0 commented Aug 24, 2023

@hyf0 is this fixed?

This is a alignment feature rather than a bug. The alignment hasn't been made.

Copy link

stale bot commented Dec 15, 2023

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!

@stale stale bot added the stale label Dec 15, 2023
@JSerFeng JSerFeng closed this as completed Feb 7, 2024
@JSerFeng JSerFeng reopened this Apr 12, 2024
@stale stale bot removed the stale label Apr 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants