-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Is there a way to resolve a dependency from a config file e.g. bower.json #966
Comments
Sounds like you want |
I can't seem to find anything about that option in the documentation. Do you mind pointing me to the right place? Or just explaining how it works from your knowledge? |
Apologies it's |
Hi @xzyfer As I mentioned in the first post, I already have setup my include paths correctly. The problem is that the necessary files aren't necessarily in the root of the folder. The actual location is stored in files such as bower.json and package.json, but there is no way to read that information and have it interpreted correctly. |
You'd need to write an importer for that. I've done something similar but for npm modules. It resolves the npm module from the import path (e.g. You should write a plugin for sass-composer 😉. |
You will need to write a custom importer. |
Implement using & in SassScript
My title might be slightly confusing so I will give an example. Right now I am installing bourbon using bower. I have set
bower_components
to be in my included paths, so then I can do@import 'bourbon'
. The problem is the main file for bourbon is nested quite deeply (/app/assets/stylesheets/bourbon
). This means when I import I have quite a long import string each time.I frequently use webpack too, and they have quite a clean approach to this in the form of a resolver plugin. I'm not sure how well this translates over to the node-sass paradigm so I thought I'd ask. With webpack I can say
new webpack.ResolverPlugin.DirectoryDescriptionFilePlugin("bower.json", ["main"])
and this automatically reads the bower.json file of an imported folder and resolves my import statement to the correct file.Is there an equivalent in node-sass?
The text was updated successfully, but these errors were encountered: