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?
Using
webpackversion4.6.0I need to resolve the path of a loader using webpack.
The loader is used like this in a
node_modulesdependency:I want to override this loader
A-loaderwith anotherB-loader.Here is how my project is structured:
I want to use webpack
resolveLoaderin order to replace the currentA-loaderintoB-loader.I'm not sure how to use it, i try but this doesn't work:
Does anybody know how can I solve this?