ember-component-css icon indicating copy to clipboard operation
ember-component-css copied to clipboard

Error during serve if both *.css and *.scss files exist

Open CrshOverride opened this issue 9 years ago • 4 comments

This issue began during an upgrade from v0.1.* to v0.2.0-beta.4.

If components in an application are defined using a mix of CSS and SCSS files, you will notice an error during ember s because the @import "pod-styles"; command can't resolve between the generated pod-styles.scss and pod-styles.css.

To Reproduce:

  1. ember new a new project.
  2. Install ember-component-css
  3. generate two components, one with _style.css and the other with _style.scss.
  4. Run ember s.
  5. Observe error.

CrshOverride avatar Apr 06 '16 02:04 CrshOverride

@CrshOverride ya. In that case you have to import with the extension. Like @import "pod-styles.css"; AND @import "pod-styles.scss";. Wasn't sure how to avoid this without putting the extension in the name and requiring you to always include the extension. How where you expecting/hoping to include all of the files? Or would you have rather not included them at all and have it be imported by default/ had to opt into including them with a config.

webark avatar Apr 06 '16 06:04 webark

@webark It would be nice to have the possibility to concat both types, scss compiled + css to a single "pod-styles". Or not?

@CrshOverride Can't you put the css into the scss file?

Silverdark avatar Apr 06 '16 07:04 Silverdark

@Silverdark the one thing about adding in the plain css after any other css has been processed is that how do you know that the plain css hasn't already been imported into the application css.

webark avatar Apr 06 '16 07:04 webark

@webark @Silverdark Personally, I wouldn't do things this way (there was a single component in our project using a *.css file that should've been a *.scss file). It's just a "regression" I noticed during the upgrade.

Importing both with extensions is a viable solution for people that need that use-case. I was thinking that, in the case there was a mix, you could treat everything as scss but as mentioned above but there are obviously issues with that approach.

CrshOverride avatar Apr 06 '16 14:04 CrshOverride