webpack-contrib / webpack-bundle-analyzer

Webpack plugin and CLI utility that represents bundle content as convenient interactive zoomable treemap
MIT License
12.57k stars 483 forks source link

Difficulties to integrate this plugin in the build flow, fails, keeps the command alive. #410

Closed rbenzazon closed 3 years ago

rbenzazon commented 3 years ago

Issue description

I have difficulties to integrate this plugin in the build flow (last stable), I had to remove it and I reintegrate it when ever I need to use it. When building concurrently several variants of a project, if I want to use this plugin, it will fail because the address is already in use. Why do we need to start a server to use this plugin ? Maybe there is an option to not start the server at all ? But do the generated files work fine offline ? I think that the default behavior should be to not start a server. Why the command is not exiting when using this plugin ? It could be because exiting the command would stop the server but it's not the case, Using 4.3.0, after forcing the command to stop, and starting again, the address is still in use which shows that the process failed to quit. I think that the default behavior of this plugin makes it mostly unusable, If I compare with a program I use with rollup, it's night and day because it has the proper behavior : no server needed and not keeping alive the command, so no pain

Debug info

I use the plugin without option

th0r commented 3 years ago

I use the plugin without option

Here are all the options you need: https://github.com/webpack-contrib/webpack-bundle-analyzer#options-for-plugin Take a look at analyzerMode, reportFilename and openAnalyzer.

valscion commented 3 years ago

Maybe there is an option to not start the server at all ?

Yes there is, see README.md ☺️

Why do we need to start a server to use this plugin ?

We don't, that's the default.

But do the generated files work fine offline ?

Yes they do

I think that the default behavior should be to not start a server.

We're not currently considering changing the defaults from what they are. Changing defaults would cause confusion in the ecosystem currently using webpack-bundle-analyzer and would be a breaking change.

Why the command is not exiting when using this plugin ? It could be because exiting the command would stop the server but it's not the case, Using 4.3.0, after forcing the command to stop, and starting again, the address is still in use which shows that the process failed to quit.

Could you describe this case more?

I think that the default behavior of this plugin makes it mostly unusable, If I compare with a program I use with rollup, it's night and day because it has the proper behavior : no server needed and not keeping alive the command, so no pain

This is completely different project than rollup so makes different tradeoffs.