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

[swc-angular-plugin] preserve styles for using this plugin for dev server #410

Closed
56789a1987 opened this issue May 26, 2024 · 2 comments · Fixed by #421
Closed

[swc-angular-plugin] preserve styles for using this plugin for dev server #410

56789a1987 opened this issue May 26, 2024 · 2 comments · Fixed by #421
Labels
enhancement New feature or request swc-angular

Comments

@56789a1987
Copy link
Contributor

I have an Angular dev server using swc, this plugin solved the code transformation problem a lot.
However this plugin discards all styleUrls and replaces them with empty styles: [].
Can we have some options to preserve styles in the result, so we can use it for Angular dev server?

@edbzn edbzn added enhancement New feature or request swc-angular labels May 27, 2024
@yjaaidi
Copy link
Member

yjaaidi commented May 28, 2024

Thanks for raising this issue.
This was indeed a shortcut we took as we focused on speeding up "browserless" testing.
We should fix this.

All PRs are welcome! 😊

@56789a1987
Copy link
Contributor Author

So I tried to add transforming styleUrls, it now works well on the dev server.
When running tests in this repo, Vitest is fine, but Jest reports error due to CSS imported as objects.

We need to either make preserving styles optional (enabled or disabled by default), or add a workaround
to the existing Jest configs (might make this a breaking change).

Which one is better?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request swc-angular
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants