-
Notifications
You must be signed in to change notification settings - Fork 12k
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 compile errors #558
Comments
Update: For example: Because the sass (perhaps also less) compiles every file, the mixin is not in the scope. Therefore you need to load it per file when needed. Also for the variable folder. |
I don't understand why #551 is closed. This and #551 are real issues with Sass support. Also I have a related question - what is the correct place to specify TIA. |
@reinos including mixins in the same file is not an acceptable solution IMHO, we need the ability to leverage SASS imports from other files. The compiler should respect files prepended with underscore and not compile them. That is the nature of SASS. I am also disappointed I cannot easily use PostCSS in the CLI, which handles vendor prefixing in the most elegant way possible. |
@steveblue agree, but thats for now my solution... |
Just for reference: Even the SASS docs are saying that files with an underscore will not be compiled: http://sass-lang.com/guide#topic-4 |
…in file patterns Allow passing in cacheInclude and cacheExclude as options to the SASSPlugin, primarily so that filenames beginning with an underscore can be ignored during SASS/SCSS compilation, which is generally accepted to be a standard in SASS (http://sass-lang.com/guide#topic-4). These config values can be set in angular-cli-build.js thus: "sassCompiler": { "cacheExclude": [/\/_[^\/]+$/] } This arguably closes issue angular#558 (angular#558)
Sass in the public folder does not compile to css in the dist folder, the files are just being straight copied and now these .scss in the dist. This issue has been reported by others. These minor bugs are prohibiting us from adopting the cli at the moment. |
I stumbled across this problem myself. So my suggestion is to add an option and a regex in angular-cli/lib/broccoli/angular-broccoli-sass.js:
This way the partials are not compiled into separate .css files and does not require you to import variables and mixins in every file. And the best thing is that they are watched, unlike the cacheExclude option, so you can enjoy the live reload while building cool stuff. :) |
@Madd would you be interested in making a PR that adds this functionality? |
@filipesilva I can do that. Will go through CONTRIBUTING.md and make a PR as soon as I can. |
Basically make the proposed change, add a test on I think that's all that matters. If you have trouble running the tests in your machine, Travis will run them anyway. |
Tests passed (edit: locally) and PR submitted #1150. |
I think Less compiling need the same functionality (excluding of partials while compiling). |
Fixed via #1150 |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
According this #551 (comment) Angular Cli is compiling all the files.
Currently i have this setup
sass/mixins/_pulls.sass (the mixin himself)
sass/mixins/index.sass (the file that load all the mixins)
sass/utils/pulls.sass (the file that call the pull mixin)
sass/utils/index.sass (the file that load all utils files)
sass/_variables.sass (the variable file)
sass/index.sass ( the file that load the files together)
Now the point is that Angular cli is compiling every file and not respect the import rule and create one file for it.
so the compiler is triggering an error on the file that call the mixin utils/_pulls.sass because the mixin file himself is compiled and not loaded into the _pull.sass file.
Is there something that i missed or does the sass compiler does not handle those structure. And how i can make this structure work.
The text was updated successfully, but these errors were encountered: