You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With the increasing adoption of ember-engines, a commonly observed pattern is to create a "common" in-repo addon that exposes shared styling, variables, mixins, functions, etc to the parent application and other in-repo engines. The instructions under the usage within in-repo addon section in the README work great. However, if you have also defined sassOptions.includePaths within the parent app's ember-cli-build.js file, it currently overwrites includePaths set within any in-repo engine.
When running ember build, it fails with an import error...
Error: Error: File to import not found or unreadable: common/vars.
This happens because on line 62 of index.js, parentOption is being merged into options, which is overwriting the includePaths value set within the in-repo engine.
I agree that we should be merging option objects with parent apps. However, I feel it's more natural for an in-repo addon to overwrite a parent app's options, instead of the other way around. In the case of includePaths, I also think merging these two arrays would be the proper fix as well.
I've tested this out in a new ember application and it's solves this use case. I'm happy to submit a PR for this. Just wanted to submit the idea first to gather feedback beforehand.
Thanks for all of your time in keeping this package updated!
The text was updated successfully, but these errors were encountered:
I'm seeing an error that seems to be related to this issue due to 18bce89.
Basically, I have an in-repo-engine that depends on ember-cli-foundation-6-sass. Due to the logic in the commit above, the includePaths defined in the in-repo-engine is overridden and I get the following error:
Summary
With the increasing adoption of ember-engines, a commonly observed pattern is to create a "common" in-repo addon that exposes shared styling, variables, mixins, functions, etc to the parent application and other in-repo engines. The instructions under the usage within in-repo addon section in the README work great. However, if you have also defined
sassOptions.includePaths
within the parent app'sember-cli-build.js
file, it currently overwritesincludePaths
set within any in-repo engine.Example
ember-cli-build.js
...lib/my-engine/index.js
...lib/my-engine/addon/styles/addon.scss
...When running
ember build
, it fails with an import error...This happens because on line 62 of index.js,
parentOption
is being merged intooptions
, which is overwriting theincludePaths
value set within the in-repo engine.I agree that we should be merging option objects with parent apps. However, I feel it's more natural for an in-repo addon to overwrite a parent app's options, instead of the other way around. In the case of
includePaths
, I also think merging these two arrays would be the proper fix as well.Proposed Solution
index.js
...I've tested this out in a new ember application and it's solves this use case. I'm happy to submit a PR for this. Just wanted to submit the idea first to gather feedback beforehand.
Thanks for all of your time in keeping this package updated!
The text was updated successfully, but these errors were encountered: