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

Unexpected/Duplicate Inclusion CSS in Build Output even without Importing in ember 5.9 #20706

Closed
zaffar415 opened this issue Jun 14, 2024 · 5 comments

Comments

@zaffar415
Copy link

zaffar415 commented Jun 14, 2024

🔬 Minimal Reproduction

I have updated my project from ember version 5.4 to 5.9.

Install ember-power-select or any addon which contains css
ember install ember-power-select

And then build project using the cmd
npm run build

And then i can see that chunk files are being created with the addon css even it is not imported in app.css file
Moreover, the scss files from my addon is also exported to the dist folder.
image

🤔 Expected Behavior

The dist folder should only contain the plain css and js which is required.
It should not have any duplicate css files with the name of chunk-*.css.

🌍 Environment

  • Ember: 5.9
  • Ember-CLI: - 5.9
  • Node.js/npm: - 20.14.0
  • OS: - Ubuntu
  • Browser: - Chrome
@kategengler
Copy link
Member

@zaffar415 Are you using embroider or only ember-auto-import?

@zaffar415
Copy link
Author

zaffar415 commented Jul 1, 2024

@kategengler

I am using the default "ember-auto-import": ^2.7.3

@kategengler
Copy link
Member

I'm not sure this is a bug -- files may be generated that aren't referenced or used by the project.

cc @ef4

@ef4
Copy link
Contributor

ef4 commented Jul 5, 2024

Yeah I don't see any bugs here. If an addon has a component that imports CSS, you don' get to pick whether the CSS gets included. It will get included if the component is included (and in a classic build, all components are always included. Under embroider only used components are included).

If an addon author wants to make their CSS optional, instead of importing it from their own component they should tell app authors to import it directly if they want it.

@kategengler
Copy link
Member

This not an ember-source issue.

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

No branches or pull requests

3 participants