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

Loader does not accept my paths #81

Closed
wspringer opened this issue Mar 14, 2016 · 2 comments
Closed

Loader does not accept my paths #81

wspringer opened this issue Mar 14, 2016 · 2 comments

Comments

@wspringer
Copy link

If I'm setting the paths option to add another load path for my less files, then webpack fails with an error:

ERROR in ./index.less
Module build failed: Cannot resolve 'file' or 'directory' ./font-awesome/less/font-awesome.less in /Users/wilfred/workspace/lesstest
 @ /Users/wilfred/workspace/lesstest/index.less (line 1, column 0)
 near lines:

   @import "font-awesome/less/font-awesome.less";

It appears the paths variable is completely disregarded, and the WebpackFileManager used internally is unable to resolve the file. Since I'm still pretty new to Webpack, I'm not sure if it violates a design principle, for all practical purposes, it would be great if the loader would support the paths property. If it does violate a design principle, then it would be really convenient if the less-loader would inform anyone attempting to use the paths property that it is not supported.

@jhnns
Copy link
Member

jhnns commented Mar 25, 2016

Yes, the path option is currently not supported. Sorry about that 😞.

If you want to import stuff from a package, you need to prepend it with a ~. In your example, that would be @import "~font-awesome/less/font-awesome.less";

There has been discussion about this lately: #74 #75

@jhnns
Copy link
Member

jhnns commented Mar 20, 2017

Starting with less-loader 4, you can now choose between the webpack resolver and the less resolver.

@jhnns jhnns closed this as completed Mar 20, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants