This configuration item is consistent in type with resolve, but this setting only affects the resolution of loaders.
resolve{
conditionNames: ["loader", "require", "node"],
exportsFields: ["exports"],
mainFields: ["loader", "main"],
extensions: [".js"],
mainFiles: ["index"]
}For instance, if you are developing a loader and want to showcase its usage from a user's perspective in an example, you can write:
module.exports = {
resolveLoader: {
alias: {
'amazing-loader': require.resolve('path-to-your-amazing-loader'),
},
},
};Then, in the example code, you can write:
require('!!amazing-loader!./amazing-file.js');The loader mentioned above uses the syntax of inline loaders. For details, please refer to here.