1

The following problem needs to be solved: I try to create a component within an ember addon, that's using sass. Within my addon I don't want to compile that scss files, that should be done within my project using ember-cli-sass and ember-css-modules-sass. The component I'm creating in my addon is also using sass modules, but I didn't install the ember packages for this, because I do that in my project.

I run into the problem, that when I try to serve my ember application from my project directory, I get the error that within my addon an imported scss file is unreadable or not there.

What am I doing wrong? Thank you very much!

andreas.teich
  • 789
  • 1
  • 12
  • 22
  • Can you please share the related code snippets? What you are trying to do is supported and done by popular addons like [Ember Bootstrap](https://www.ember-bootstrap.com/). – jelhan Feb 12 '20 at 21:05
  • Let me ask different: what would be the correct way to follow? – andreas.teich Feb 13 '20 at 08:53
  • 1
    It should be fine if you put the `*.scss` files in `app/styles` folder of your addon. It's merged with `app/styles` of your app on build time. This allows you to import it as if the file were part of the app. You must ensure that you don't have name conflicts. A convention to do so is using a folder with the name of the addon. – jelhan Feb 13 '20 at 12:07

1 Answers1

0

Add the Sass files to /app/styles/, not /addon/styles. This way they will be merged with the host app.

Charles Fries
  • 368
  • 2
  • 12