parallel-webpack icon indicating copy to clipboard operation
parallel-webpack copied to clipboard

does not work with webpack 5

Open gianlucalarizza opened this issue 4 years ago • 11 comments

Explain the problem

Dear, this very useful plugin does not work with webpack 5. Unfortunately. Thank you

Expected Behaviour

Actual Behaviour

Steps to reproduce

Provide your webpack config

Provide your Environment details

  • Node version:12.16.3

  • Operating System:

  • webpack version: 5

  • parallel-webpack version: 2.6.0

gianlucalarizza avatar Oct 13 '20 10:10 gianlucalarizza

👀

giancarlosisasi avatar Nov 11 '20 15:11 giancarlosisasi

any updates?

zhongzhong0505 avatar Dec 08 '20 12:12 zhongzhong0505

I gave this a try and webpack 5 worked as expected with parallel-webpack. Just make sure to follow the migration guide and update all webpack-related dependencies. https://webpack.js.org/migrate/5/

lfalke avatar Dec 28 '20 14:12 lfalke

Doesn't work with stats because presetToOptions should be replaced with compilation.createStatsOptions

Derbdale avatar Jan 04 '21 11:01 Derbdale

This only occurs if you're using a string reference to your stats. e.g. stats: "minimal".

If you change this to

stats: {
    preset: "minimal"
}

It will build with webpack 5. 🎉

culshaw avatar Mar 15 '21 12:03 culshaw

This only occurs if you're using a string reference to your stats. e.g. stats: "minimal".

If you change this to

stats: {
    preset: "minimal"
}

It will build with webpack 5. 🎉

It will not, obviously. Webpack stats config doesn't have preset key and leaving stats with minimal value still leads to that presetToOptions error.

Defite avatar Jul 30 '21 11:07 Defite

Doesn't work with stats because presetToOptions should be replaced with compilation.createStatsOptions

But you can't, because presetToOptions was static method of Stats class and createStatsOptions is not static method in Compilation class.

Defite avatar Jul 30 '21 12:07 Defite

@Defite I've been reviewing the Webpack config and it seems the config @culshaw has shared is valid. stats accepts a boolean, a string or a StatsOptions object and this type can has an optional preset key as you can see in the type definition file from webpack repo.

I've tried this config using parallel-webpack and it has worked as expected.

guerrero avatar Sep 20 '21 05:09 guerrero

Solved by changing stats from 'none' to false.

https://webpack.js.org/configuration/stats/#stats-presets

imaegoo avatar Sep 23 '21 09:09 imaegoo

Is this project still active? I see that the last commit was almost 1-1/2 years ago.

If this project is in fact defunct, what's the replacement?

MartinFalatic avatar Sep 23 '21 18:09 MartinFalatic

Is this project still active? I see that the last commit was almost 1-1/2 years ago.

If this project is in fact defunct, what's the replacement?

None of the original authors still work at trivago. With all of the improvements in Webpack through the last years, the advantage of parallel builds has been reduced to the point where trivago stopped using this project entirely.

I'd recommend using Webpack directly. In most cases that should be good enough.

pago avatar Jan 21 '22 08:01 pago