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
For example, I am using materialize-css, and in addition to being able to import the JS into components I want to @import SASS assets in my styles. Thus far I've been accomplishing this by using something like this in my ember-cli-build.js:
There are no conventions, so doing what you're doing is fine.
There are several different possible things people might mean when they think of importing CSS or SASS:
Replacing app.import of CSS (or anything that is being transpiled into CSS), so that apps could say import "some-package/some.css" and that would cause it to automatically end up in vendor.css. That's a pretty small change and not hard to implement. I would like to add this.
Dynamic import of CSS (meaning await import('some-package/some.css') would resolve once the given CSS is added to your document). This either already works or would be a small addition.
Making @import 'some-pacakge' in your SCSS or CSS file automatically resolve to some-package from NPM and cause build-time inclusion. This is also something I would like to do, but it doesn't fit inside ember-auto-import. It's on my world-domination plan, but not until a later stage where the things ember-auto-import are doing have moved directly into ember-cli.
Thanks for the reply. I am most interested in the 3rd one, as it seems a lot more intuitive to me (at least for a new user) to try node_modules/some-package when doing @import 'some-package' in stylesheets rather than have to find the magic place to wire that up (though once you know it, it is kind-of nice to have it be so explicit).
For example, I am using
materialize-css
, and in addition to being able to import the JS into components I want to@import
SASS assets in mystyles
. Thus far I've been accomplishing this by using something like this in myember-cli-build.js
:Should I keep doing this or does
ember-auto-import
do something in this space as well?The text was updated successfully, but these errors were encountered: