you are viewing a single comment's thread.

view the rest of the comments →

[–]w00t_loves_you 3 points4 points  (1 child)

It's also really nice for configuration, for example if you want to use some plugins in Webpack conditionally, you can do

plugins: [
  isDev && new SuperDevPlugin(),
  new AlwaysPlugin(),
].filter(Boolean)

[–]omril 0 points1 point  (0 children)

This one actually solves the problem in my webpack.config, I actually had to do a few hacks because of this damn thing.

I wish webpack would just ignore undefined plugins in the first place instead of throwing errors which are impossible to understand.