trivago / parallel-webpack

Builds multi-config webpack projects in parallel
BSD 3-Clause "New" or "Revised" License
1.48k stars 96 forks source link

does not work with webpack 5 #107

Open gianlucalarizza opened 4 years ago

gianlucalarizza commented 4 years ago

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

GiancarlosIO commented 3 years ago

👀

zhongzhong0505 commented 3 years ago

any updates?

lfalke commented 3 years ago

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/

Derbdale commented 3 years ago

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

culshaw commented 3 years ago

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. 🎉

Defite commented 3 years ago

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 commented 3 years ago

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.

guerrero commented 3 years ago

@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.

imaegoo commented 3 years ago

Solved by changing stats from 'none' to false.

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

MartinFalatic commented 3 years ago

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?

pago commented 2 years ago

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.