Skip to content
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

Error on SASS Partials in 1.x #68

Closed
JamesHenry opened this issue Mar 23, 2015 · 9 comments
Closed

Error on SASS Partials in 1.x #68

JamesHenry opened this issue Mar 23, 2015 · 9 comments

Comments

@JamesHenry
Copy link

Hi @jhnns,

I am not a node-sass expert by any means, and so I cannot comment on exactly what the desired end result should be, but I make extensive use of SASS partials in my code and the handling of them seems to have changed when moving from 0.x to 1.x.

For example:
If I have file _my-partial.scss, I would expect to (as working in 0.x) be able to reference it in my main SCSS file as @import "my-partial".

In 1.x, you have to explicitly write the underscore, but as I understand it, the underscore is what signifies to SASS that it is indeed a partial.

More info: http://sass-lang.com/guide

Many thanks for your hard work on sass-loader!

James

@confiks
Copy link

confiks commented Mar 24, 2015

I ran into the same issue today when upgrading to 1.0.0. All my import statements of partials yielded 'file to import not found' errors. If it is intentional that partials should now be referenced with an underscore, a note should be added to the readme.

My setup is roughly: create a webpack config with config.entry = ['./entry.js']. In entry.js use require('scss/app'). In scss/app.scss use @import 'somepartial';. Previously this would have loaded the file scss/_somepartial.scss, but it now fails with an error. @import './somepartial'; fails as well. Using @import '_somepartial'; works however.

Related question: Now issue #39 has been implemented, what is really the difference between a partial import and a regular file import?

@jhnns
Copy link
Member

jhnns commented Mar 24, 2015

The files are now resolved by webpack, and webpack doesn't care about the _ mechanism. However, since Sass users are expecting this feature to work (although it has nothing to with the language itself and should imho not be part of the specification, but that's another topic 😉), I'm willing to implement this feature.

If you don't want to replace all your import statements, I recommend to stick with sass-loader 0.x for now. There are also some issues on OSX afaik #65.

@jhnns
Copy link
Member

jhnns commented Mar 31, 2015

Should be fixed with 1.0.1

@jhnns jhnns closed this as completed Mar 31, 2015
@mrsum
Copy link

mrsum commented Apr 30, 2015

@import 'blocks/*'; -> File to import not found or unreadable: ./blocks/_*.sass

I have:
"node-sass": "^3.0.0-beta.7",
"sass-loader": "^1.0.1",

@jhnns
Copy link
Member

jhnns commented May 6, 2015

Is that a wildcard or do you have a file called *.scss? Wildcards are not supported.

@hiroshi
Copy link

hiroshi commented Sep 7, 2015

@mrsum FYI
for glob import, https://github.com/Aintaer/import-glob-loader seems to work for me.

@jhnns
Copy link
Member

jhnns commented Oct 23, 2015

#151

Are globs supported by Rubysass? Why are people expecting this to work?

@ghost
Copy link

ghost commented Feb 13, 2018

webpack causing more problem than it solves. Why this would not work i don't get it.

@alexander-akait
Copy link
Member

@atilkan what you problem? please create issue (better with minimum reproducible test repo)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants