-
-
Notifications
You must be signed in to change notification settings - Fork 91
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
Sass dependencies in addon #83
Comments
I presume you're adding |
That is correct |
I'd like to say that I can dive in and have a look at this, but I'd be lying - I've got my plate full with completely non-Ember things. @dukex and @stefanpenner, any thoughts on this one? This sounds like a reasonable use case, and I think that this should just work. Maybe ember-cli isn't providing the right trees when developing an addon. |
The ember-cli use the The only way I see to make it works today is putting sassOptions config on ex: 'use strict';
module.exports = function(/* environment, appConfig */) {
return {
sassOptions: {
includePaths: ['bower_components/material-design-lite/src']
}
}; }; But you'll receive a deprecated note:
|
If I understand correctly @artlowel is trying to get the SASS compiled into vendor.css. Would this approach achieve that goal? I'd be happy to remove that deprecation if this is the solution for this problem. It was really just added to help people migrate away from that method (which never should have been used in the first place). |
@aexmachina Yes, works like expected Just to confirm I made an example app using foundation as README.md. The problem with module.exports = function(/* environment, appConfig */) {
var foundationPath = require('path').join(__dirname, '..', 'bower_components', 'foundation', 'scss');
return {
sassOptions: {
includePaths: [ foundationPath ]
}
};
}; |
Two things there: a) we want to avoid hacks - they give you headaches in
the future! and b) the goal here is to compile the sass into vendor.css -
so it would only happen when the addon is being built - not when the app is
built.
|
I can confirm that the solution proposed by @dukex works for me as well. A more robust solution would be nice, but this will do for now. Thanks for the swift replies! |
I have the same use case, wanting to make use of bourbon.io lib in the add-on and also make it available to any consuming app. Adding it to Just wondering; not having such settings in |
I spotted this add-on that uses The same approach works in my add-on, where bourbon can be imported in the consuming app and the add-on itself but then Another test; Keeping From what I've observed; when If I move code invoked by
imports start working again but goes back to |
Is this resolved by #106? |
Closing due to inactivity, feel free to reopen. |
It appears this issue is still a problem: package.json
ember-cli-build.js
addon/styles/addon.sass
index.js
|
I have an addon that uses sass, but also needs to import a 3d party sass lib, and I can't seem to get that last part right. I want to do something similar to the foundation example in README.md, but import it in the addon instead of the app.
When I add the lib to
sassOptions.includePaths
and@import 'libname'
in addon.scss I get the error: "file to import not found or unreadable". If I do the same thing in the host app's app.scss it compiles just fine, and that would suffice in most cases. But I want to be able to use the lib's variables and mixins in my addon's sass files, and since they get compiled to vendor.css, separate from the host app's css, those variables and mixins can't be found during compilation.Can someone point me in the right direction?
The text was updated successfully, but these errors were encountered: