Skip to content

less-loader blocks less node_modules support #276

Closed

Description

@matthew-dean

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?)

Activity

  1. jhnns commented on Apr 25, 2019

    @jhnns
    Contributor

    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.

  2. cap-Bernardito commented on Apr 18, 2020

    @cap-Bernardito
    Contributor

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions