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

fixes the way imports are loaded #28

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

xavierlacot
Copy link

The imports path resolution is done in an incomplete way, as it only relies on a combination of the current directory (process.cwd()) and the options.includePaths that the user might pass.

This PR will use the options.file parameter to try and guess the right pass of the imported resource. As is, it even makes the options.includePaths option useless (but it was kept for BC purpose).

xavierlacot added a commit to xavierlacot/grunt-stss that referenced this pull request May 27, 2015
@vdesdoigts
Copy link

👍

@RonaldTreur
Copy link
Owner

Hi @xavierlacot,

First off thanks for your time and contributions! Secondly, my sincere apologies for the late response!

Having said that, I'm not entirely sure what it is you're trying to accomplish here. Could you (or someone else) please show me a basic use-case that demonstrates what didn't work before, but will work with this change?

If options.file was passed, then the path that contains the STSS file will be appended to options.includePaths already. On first glance it seems your proposed change has no actual effect, but perhaps I'm simply thinking in the wrong direction.

I do see a minor redundancy issue in the current code, but since that touches options.file as well, I won't fix that right away.

@xavierlacot
Copy link
Author

Hi Ronald,

Sorry, it has been a long time and I am not sure to remember perfectly.

As far as I can remember, when using stss with @imports in parent- or sub- directories, the path resolution was not made correctly and resulted in file inclusion errors. Using a declarative way to pass the whole path of the included file allows to avoid this concern.

Moreover, this allows to optimize the binding with grunt-stss, as stated in xavierlacot/grunt-stss@fa301fc

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

Successfully merging this pull request may close these issues.

3 participants