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

Missing styles.css in package.json sideEffects #1737

Closed
Woyken opened this issue Dec 14, 2023 · 1 comment · Fixed by #1738
Closed

Missing styles.css in package.json sideEffects #1737

Woyken opened this issue Dec 14, 2023 · 1 comment · Fixed by #1738
Labels
bug Something isn't working

Comments

@Woyken
Copy link
Contributor

Woyken commented Dec 14, 2023

Describe the bug (actual behavior)

I'm using webpack with ESM. When importing styles.css it gets treeshaken-out.
And styles are missing completely in output

Possible webpack bug: webpack/webpack#7094

Expected behavior

importing styles.css just works

Reproduction

Link to a minimal repro:
Bug reproduction
https://stackblitz.com/edit/webpack-5-react-starter-zvm3dw?file=src%2Fapp.tsx,package.json

Patched version with "sideEffects": ["styles.css"]
https://stackblitz.com/edit/webpack-5-react-starter-m3a2tr?file=src%2Fapp.tsx,package.json

Steps to reproduce
  1. Use webpack bundler with ESM
  2. Import iTwinUI styles.css
  3. no css in output

Additional information

Possible solution:
Add package.json sideEffects for styles.css file

{
    sideEffects: ["styles.css"]
}
@Woyken Woyken added the bug Something isn't working label Dec 14, 2023
@mayank99
Copy link
Contributor

fixed in 3.1.1, thanks for your PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants