-
Notifications
You must be signed in to change notification settings - Fork 234
How to prepend rule loaders? #28
Comments
I can't say that I have the best answer to this problem right now. This wouldn't be the easiest to work around in Webpack either, as you need to know the right injection point in the array to insert the other loaders at. My recommendation would probably be to restructure how you require these 2 together. Consider requiring // development.js
const config = new Config();
config.module
.rule('Javascript')
.test...
require('./base')(config);
module.exports = config.toConfig(); |
Closing as resolved. If this solution doesn't work, please feel free to reopen and discuss. Thanks! |
@eliperelman That looks like a fantastic solution to my issue! Thanks. I'll keep an eye out for the release! |
@eliperelman add this feature plz in docs. I found about this feature only here. |
Thanks for this PR. But it look like nothing docs about this in README.md. Hope can update it in the docs. |
Just wanted to note that this exists here now: https://neutrinojs.org/webpack-chain/#config-plugins-ordering-before Because this issue was the top result when I searched :) |
Loaders on rules are order dependent, yet, looking at the source code for webpack-chain, it's being treated as a map (rule.uses). How would you inject a loader at the head of the loader chain? Right now, i have to
clear
the uses but that feels like it defeats what webpack-chain is trying for.The text was updated successfully, but these errors were encountered: