openAnalyzer: false is ignored
vxsx opened this issue · 4 comments
vxsx commented
Describe the issue
with the configuration
analyzer({ analyzerMode: 'static', openAnalyzer: false }),
the server starts, instead of finishing the build
Expected behavior
It still runs the server, because preferOpenServer
is true even if openAnalyzer
is false
vite-bundle-analyzer/src/server/index.ts
Lines 71 to 72 in 7da1da7
Steps to reproduce
Just run the build with this configuration.
Test case
No response
Additional comments
No response
vxsx commented
I understand starting the server and opening browser are slightly different things, but i expect "static" mode to not start the server.
I believe the fix would be just to add the condition
const preferOpenServer = opts.analyzerMode === 'server' || (opts.analyzerMode === 'static' && opts.openAnalyzer)
nonzzz commented
Done! new version is released.
vxsx commented
Yup, works with the new version. Thanks a lot!