You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is it possible to modify less's path resolution without making a custom build?
I work on StealJS, which supports using AMD/CJS/import to load from npm packages (and has supported LESS at least 5 years). In short, people want to be able to write:
The problem is that I can't also run my "pre-less" transpiler on styles.less. There's no hook for path resolution or when the file gets loaded. So styles.less doesn't get updated with the right path to bootstrap:
@justinbmeyer There's a conversation thread on #2615 that you'd probably want to read through. By the end it had gotten close to consensus, other than the keywords. Maybe you could put in your $0.02.
Specifically, @seven-phases-max objected to the word "modules" as one of the options. As neither of us are asking for the feature, maybe some suggestions could come for people who want this. Does this match your use case?
As I understand this is exactly what #2618 is about. In summary:
use https://github.com/less/less-plugin-npm-import.
_Or_, considering specific `StealJS` use-case, provide your own path resolution plugin with whatever desired behavior.
So merging this to #2618 (re-open if I'm wrong).
P.S. After thinking of it a bit more, I guess it's actually better to rephrase this to a simple answer (w/o even referencing all those tickets):
Is it possible to modify less's path resolution without making a custom build?
I work on StealJS, which supports using AMD/CJS/import to load from npm packages (and has supported LESS at least 5 years). In short, people want to be able to write:
And
styles.less
might look like:Both
package
andbootstrap
are be located somewhere withinnode_modules
that I'm able to locate.My guess is that other module loaders will like this same feature (or have already figured out how to do it).
I've already written a "pre-less" transpiler that takes:
And converts it to something like:
The problem is that I can't also run my "pre-less" transpiler on
styles.less
. There's no hook for path resolution or when the file gets loaded. Sostyles.less
doesn't get updated with the right path to bootstrap:TLDR;
Are there hooks for either:
Thanks!
The text was updated successfully, but these errors were encountered: