Can make 'grass::from_string_with_file_name' as pub?
As title, I need use grass in my custom project, there are some complicated path calculation need to do, such as custom alias rules. But found that 'grass::from_string_with_file_name' can not be used.
Hello,
I am happy to do this, though I am interested a bit more in your specific use case. That file name should only be used in error messages when the error occurs in the main file. Is there any reason you wish to change this? Perhaps you are looking for grass::Options::fs, which will allow you write code to intercept imports.
I saw that grass::Options::fs needs a 'Fs' as param. I just want to implement a alias importer for '@scss/...', is there a simple example?
Actually I am working on custom importers like libsass in rust.
Closing this issue as grass::Options::fs should allow one to solve the problem as described. You can find a simplified example of this in our tests:
https://github.com/connorskees/grass/blob/39c992a2eb9f2ef75175726b6e206b158349319e/tests/macros.rs#L117-L122
A simple importer implementation should be able to just strip the @scss/ prefix before passing the path to the file system.