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

less-loader blocks less node_modules support #276

Closed
1 of 3 tasks
matthew-dean opened this issue Nov 21, 2018 · 2 comments
Closed
1 of 3 tasks

less-loader blocks less node_modules support #276

matthew-dean opened this issue Nov 21, 2018 · 2 comments

Comments

@matthew-dean
Copy link

matthew-dean commented Nov 21, 2018

This issue is for a:

  • bug
  • feature request
  • modification request

Expected Behavior

Less 3.x+ should be able to import from node_modules by default without ~

Actual Behavior

less-loader's resolver forces a ~ even though none is necessary and can't resolve Less code in node_modules without ~, even though that should work in Less 3.x+

In fact, if you comment out...

install(lessInstance, pluginManager) {
      //pluginManager.addFileManager(new WebpackFileManager());
    },

...then Less imports any given library from node_modules. e.g.:

@import 'iview/src/styles/index.less';  //imports from NPM iview module

So the file manager is actually blocking NPM / Node support unnecessarily. (Although it probably provides other Webpack resolving support?)

@jhnns
Copy link
Member

jhnns commented Apr 25, 2019

You can switch to Less' resolver by specifying paths. Even an empty array should work 😁.

Using Webpack's resolver as default was a design mistake. Maybe I will do a breaking change someday.

@cap-Bernardito
Copy link
Member

Will be fixed in the next release

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

3 participants