-
Notifications
You must be signed in to change notification settings - Fork 15
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
sassOptions.extension = sass gets ignored and app/styles/app.scss: no such file or directory is thrown #36
Comments
@ohcibi We are using dart-sass as the sass compiler. Per the documentation, there is no |
@hilljh82 Sass files with a Mind that parsers/compilers do not care for file extensions. The extension translates to an option for enabling or disabling indented syntax. The CLI decides about it before parsing begins (or better: can begin as the wrong option would result in a syntax error at the end of the very first line of course): https://github.com/sass/dart-sass/blob/a10d7c677dd90f9f5731fa220d1553af620bedea/lib/src/executable/options.dart#L155 In fact, this plugin's dart-sass-plugin module has an Adding from experiences we learned with ember-cli-sass: The main root cause for errors is the 'feature' to auto import any addon.scss … Here is the extension for every layer of addon/sub-addon needed to be correct. Addon authors should rather add a styles module with the name of the addon and make their blueprints, add that to app.scss if they really want to enforce their styles upon the developer. |
This is the line where the plugin reads an
|
@ohcibi First, let's just focus on the issue at hand, which is the extension being recognized within Would you mind submitting a pull-request to fix the extension problem you are currently having? If the problem goes into issues with the sass compiler itself, which you seem to elude too, then we may have to just table this issue. |
The issue is that the plugin somehow tries to import an app.scss with scss being hardcoded... i cannot find that place, otherwise I'd had pull requested.. I don't have too much experience with blueprints either, maybe its some magic there. But i can find quiet a few places where .scss is hardcoded (by grepping). These and other places where the plugin was written with the expectation of only one file extension, need to be changed to support all three possible. There is a workaround which is to add an app.scss that @uses the real stylesheet with the sass extension. This is a proof that there is no issue at all with dart-sass by the same time. The issue in its own words is the 'entrypoint' of the sass file. I think it would be better to let the developer define that instead of that
I haven't looked too much into the api of dart-sass when used from within node. Maybe their option parser can be utilized somehow which would make it a matter only of telling the parser that very name and the rest is handled properlyby dart.. Could also be that a test for sass vs scss is necessary to explicitly set the Finally is it worth the hassle? I don't know how far we are with embroider/webpack, maybe that one will handle it in a better way anyways? As you can see theres quieet a few questions before pring 8-)) |
@ohcibi Ok, I will go ahead and label this as an enhancement. We are working on updating ember-cli-mdc to support material-components-web 11.0. Maybe we can enhance the ember-cli-mdc-sass add-on to better support what you describe above. |
Again I suggest to extract the project from the mdc domain. Theres a lot more people interested in sass/scss than only those who want to work with mdc. I wasn't even aware that there is a modern replacement for ember-cli-sass until I got to work with material and this issue's general problem is a known issue from good ol ember-cli-sass and I guess theres some people who have different or even better workarounds/solutions for this. |
@ohcibi Personally, I do like having to maintain a separate version of a SASS compiler. The reason we have a separate sass add-on in ember-cli-mdc is the original ones were very slow and did not scale to our needs. Even with the most recent versions, any live update would take up to 2 minutes to process due to the sass build process. Based on what you state above, this is really no longer a ember-cli-mdc problem/bug. Additionally, it seems that allowing different extension support at the level you are suggesting is outside the scope of this project as well. |
Note that this issue is different from #4 where the author is using an
app.sCss
file and not anapp.sAss
file. I've setsassOptions: { extension: 'sass' }
in ember-cli-build.js but still get this error when building my app.Steps to reproduce
sass
It looks like in this and the following lines:
ember-cli-mdc/packages/mdc-sass/lib/sass-compiler.js
Line 29 in 715b004
sassOptions
passed to the compiler are build manually instead of extending on the user config. Other keys are likely to get lost as well with that.The text was updated successfully, but these errors were encountered: