Skip to content
This repository has been archived by the owner on Aug 8, 2019. It is now read-only.

How to resolve loader in webpack 4? #113

Open
pnepe6 opened this issue Jun 8, 2018 · 0 comments
Open

How to resolve loader in webpack 4? #113

pnepe6 opened this issue Jun 8, 2018 · 0 comments

Comments

@pnepe6
Copy link

pnepe6 commented Jun 8, 2018

Using webpack version 4.6.0

I need to resolve the path of a loader using webpack.

The loader is used like this in a node_modules dependency:

const loadedIndex = require('!!../loaders/A-loader!./index.js');

I want to override this loader A-loader with another B-loader.

Here is how my project is structured:

_ directory
  |_ node_modules
     |_ lib
        |_ loaders/A-loader.js
        |_ index.js
  |_ loaders/B-loader.js

I want to use webpack resolveLoader in order to replace the current A-loader into B-loader.

I'm not sure how to use it, i try but this doesn't work:

{
    resolveLoader {
          alias: { 
               'A-loader': 'path/to/my/directory/loaders/B-loaders.js'
          } 
    }
}

Does anybody know how can I solve this?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant