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

fix(css): should generate css assets even if the imported css file is empty #2759

Merged
merged 7 commits into from
Apr 16, 2023

Conversation

suxin2017
Copy link
Collaborator

@suxin2017 suxin2017 commented Apr 15, 2023

Summary

Fixes #2670

🤖 Generated by Copilot at 0fb3f68

This pull request enhances the rspack_plugin_css plugin, adds a new test fixture for importing empty CSS files, and fixes some minor code style issues. The changes aim to improve the functionality, reliability, and consistency of the rspack web development tool.

Related issue (if exists)

Walkthrough

🤖 Generated by Copilot at 0fb3f68

  • Filter out errors and empty sources from CSS plugin results (link)
  • Simplify logic of returning render manifest entry for CSS plugin (link)
  • Fix indentation of style.module.css file (link)
  • Add package.json file to import-empty-css-file fixture (link)
  • Add rspack.config.js file to import-empty-css-file fixture (link)
  • Add empty.js file that imports an empty CSS file (link)
  • Add index.html file that displays test result (link)
  • Add index.js file that dynamically imports empty.js and sets text to "ok" (link)
  • Add index.test.ts file that asserts importing empty CSS file does not throw error (link)
  • Fix quotation marks of compare-versions import in ResolveSwcPlugin.ts (link)
  • Add entry for import-empty-css-file fixture to pnpm-lock.yaml (link)

@changeset-bot
Copy link

changeset-bot bot commented Apr 15, 2023

⚠️ No Changeset found

Latest commit: 0fb3f68

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@hyf0
Copy link
Collaborator

hyf0 commented Apr 15, 2023

I did some investigation at #2747. But the PR was reverted due to causing some tests failed.

You might get some inspiration from it. Feel free to ping me if you have any questions.

@hyf0 hyf0 self-assigned this Apr 15, 2023
@suxin2017
Copy link
Collaborator Author

I did some investigation at #2747. But the PR was reverted due to causing some tests failed.

You might get some inspiration from it. Feel free to ping me if you have any questions.

👌

@suxin2017
Copy link
Collaborator Author

suxin2017 commented Apr 16, 2023

I did some investigation at #2747. But the PR was reverted due to causing some tests failed.

You might get some inspiration from it. Feel free to ping me if you have any questions.

How to detect this alert
An error occurred: Maximum call stack size exceeded

@suxin2017 suxin2017 marked this pull request as ready for review April 16, 2023 03:17
@suxin2017 suxin2017 changed the title fix: 2670 fix: 2670 Empty scss or css file is referenced by bundle but bundle is removed Apr 16, 2023
@hyf0 hyf0 changed the title fix: 2670 Empty scss or css file is referenced by bundle but bundle is removed fix(css): should generate css assets even if the imported css file is empty Apr 16, 2023
Copy link
Collaborator

@hyf0 hyf0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work. Thank you!

@hyf0 hyf0 added this pull request to the merge queue Apr 16, 2023
Merged via the queue into web-infra-dev:main with commit 6250d66 Apr 16, 2023
12 checks passed
siyou pushed a commit to siyou/rspack that referenced this pull request May 14, 2023
… empty (web-infra-dev#2759)

* fix: 2670

* test

* chore: add test

* fix: test case

* chore: rm gitpod
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug Report]: Empty scss or css file is referenced by bundle but bundle is removed
2 participants