I looked it up at the docs here and here, searched StackOverflow and GitHub discussions and still can't find this information. Is there any resource or does anyone knows if the order of the plugins matter in Webpack? And how does the ordering work?
Yes, the order matters: plugins are bound to the compiler and applied in the order specified. You can look into webpack/tapable
for a clearer idea on how this works.
Usually, though, you are not forced to think about ordering when binding compiler and compilation plugins, as plugin authors expose specific events that help you reason when your handlers will be invoked.
-
22This could be more clear in the documentation :/. A year later and I'm still searching for the same thing. – Andrew Craswell Jan 2 '18 at 22:23
-
2How does that link show how to set up the build order for a node project? – claudekennilol Apr 9 '19 at 22:04
-
5There are many questions unanswered. How the order on the
webpack.config.js
plugins
array affects the build process? Are plugins executed after or before loaders? Can webpack plugins be chained in series or parallel in the same way than gulp? I can see thetapable
package offers some of that functionality. But it's hard to tell how the whole plugin system works in the end without a clearer explanation. – AxeEffect Apr 13 '20 at 12:50
webpack is not a task runner. These plugins are tasks, which is not "webpack-style" and not supported. You can report the issue there, but there is nothing to do on webpack side (and I don't care much). -sokra