-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
resolving @import #2039
Comments
What do you mean by "loading/resolving"? |
I want to tell Stylus where to find the imports - or even provide them. Similar to https://mozilla.github.io/nunjucks/api.html#loader or https://github.com/less/less-plugin-npm-import/blob/master/lib/npm-file-manager.js |
I see. Unfortunately Stylus' importer is not extensible in this way currently. |
@Panya Urgh - that's unexpected Stylus has one of the nicest APIs from the other alternatives out there. So how do we fix this oversight? :) If you guide me a little I might be able to help. |
Seems like this is where things need to change a little |
It will be a little bit harder :) We need to extract default logic for importing files from the evaluator. These methods are importFile (messy) and visitImport. |
@Panya well, that would have been too easy otherwise ;) Maybe we start thinking about the API and then see how it could be implemented in those places.
The Sounds sane? |
Yep, but you also need to know that all internal Stylus' processes are currently synchronous, so that would limit the functionality to synchronous-only resolvers (otherwise we need to go deeper :)). |
Synchronous is fine - for me, for now :) |
Hi~~~ |
@SamHwang1990 that sounds like a very different issue. Better open an individual issue for it. |
@Panya tag as enhancement request? I will see if I can find some time to dig into this (fingers crossed) but as |
While the docs here are great https://github.com/stylus/stylus/blob/dev/docs/import.md they left me wondering how to control the loading/resolving of imports. I am using stylus on Node:
Is this possible at all?
The text was updated successfully, but these errors were encountered: