
Webpack 4 breaking change for plugin system - manigandham
https://medium.com/webpack/the-new-plugin-system-week-22-23-c24e3b22e95
======
skrebbel
I'm very happy to read that they plan provide full backward compatibility in
nearly all cases. Way to go! If you really must make a breaking change, this
is how to go about it.

------
pspeter3
I'm glad the Plugin API is being standardized. I feel like this will enable
webpack to be more successful.

------
falsedan
I see they’re solving the dependent plugins problem by making the plugin
smart; I prefer the approach taken by Dist::Zilla[0], where resolving is done
manually by the user, by specifying the order they run in, in the config file.

0: [https://metacpan.org/pod/Dist::Zilla::Tutorial#HOW-BUILDS-
GE...](https://metacpan.org/pod/Dist::Zilla::Tutorial#HOW-BUILDS-GET-BUILT)

~~~
shados
How does that work for internal plugins? Webpack itself is essentially nothing
BUT a stack of internal plugins (the webpack core does almost nothing, even
internally).

So how do you order plugins relative to other plugins you don't have control
over? (This is an honest question, as I'm trying to solve a similar issue in
one of my projects)

~~~
falsedan
> _So how do you order plugins relative to other plugins you don 't have
> control over?_

Let the user decide, like this?

    
    
        [external plugin 1]
        some options = do stuff
        [internal plugin A]
        ; etc.
        [external plugin 2]
        [external plugin 3]
        [internal plugin B]
    

where all of these plugins are the same type (e.g. pre-build, post-compile).
If that's too verbose, then plugin bundles & the Filter bundle are the way to
go:

    
    
        [external plugin 1]
        some options = do stuff
        [internal plugin A]
        ; etc.
        [@Filter/@Basic]
        -without = external plugin 1
        [internal plugin B]
    

If you have a strong need for your plugin to run after one but before another,
and they're all in the same step, then maybe they should be separated into two
steps.

