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

sass-graph should prefer cwd over loadPaths for @imports #12

Closed
schnerd opened this issue Feb 18, 2015 · 5 comments · Fixed by #28
Closed

sass-graph should prefer cwd over loadPaths for @imports #12

schnerd opened this issue Feb 18, 2015 · 5 comments · Fixed by #28

Comments

@schnerd
Copy link

schnerd commented Feb 18, 2015

I ran into an issue running sass-graph on a larger project. There are two modules within this project that contain a "_base.scss". All scss files in module 1 that imported _base worked correctly, but when it was time to compile scss files in module 2, their @import statements were resolving the _base.scss from module 1 instead of the one in the CWD.

mod1/_a.scss
mod1/b.scss
   @import "a";
mod2/_a.scss
mod2/b.scss    
   @import "a";  // graph.index['mod2/b.scss'].imports === ['mod1/_a.scss']

By default, I believe Sass will look for imports in the CWD and then look in any include paths from there

Sass looks for other Sass files in the current directory, and the Sass file directory under Rack, Rails, or Merb. Additional search directories may be specified using the :load_paths option, or the --load-path option on the command line. - Source

I'm opening up a PR that I think will fix the issue, curious to hear your feedback.

@xzyfer
Copy link
Owner

xzyfer commented Mar 5, 2015

Sorry I haven't been receiving GH emails.

Makes sense! I'll take a look shortly. Thanks!

@xzyfer xzyfer closed this as completed Mar 5, 2015
@xzyfer xzyfer reopened this Mar 5, 2015
@danbroooks
Copy link

+1 for this

@jfridye
Copy link

jfridye commented Apr 27, 2015

+1

@kkopachev
Copy link

+1. Could not use node-sass watcher because of this, it's always compiling wrong partials.

@xzyfer
Copy link
Owner

xzyfer commented Apr 29, 2015

My apologies for the silence here. This issue is top priority and will be resolved shortly for the node-sass@3.0.0 release. sass/node-sass#905

@xzyfer xzyfer mentioned this issue May 4, 2015
5 tasks
@xzyfer xzyfer closed this as completed in #28 May 4, 2015
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

Successfully merging a pull request may close this issue.

5 participants