Closed richerfu closed 2 years ago
Hi, thanks for the pull request! How are you intending to use this change in your application?
Actually, i create a cli tool for my team.
example for use
const BundleAnalyzerPlugin = require("webpack-bundle-analyzer").BundleAnalyzerPlugin;
// webpack.config.js
plugin: [
new BundleAnalyzerPlugin({
host: '0.0.0.0',
logInfo: () => {
// some other logic
return 'custom log info';
}
})
]
I will add analytics in cli tool. If i can use it like this demo.I think it's fine
copy that! I fixed. Any other suggestions?
If you could add a changelog entry to CHANGELOG.md
then I think this is OK. You will also need to sign the CLA like the bot commented above:
https://github.com/webpack-contrib/webpack-bundle-analyzer/pull/520#issuecomment-1216212707
copy that! I fixed. Any other suggestions?
If you could add a changelog entry to
CHANGELOG.md
then I think this is OK. You will also need to sign the CLA like the bot commented above:
OK,i finished!
OK so the usage could look something like this, right?
plugins: [
new BundleAnalyzerPlugin({
analyzerUrl: ({ listenPort, listenHost, boundAddress }) => {
return `http://some-domain.example.com:${boundAddress.port}`;
}
})
]
Can we add a short documentation to the README.md about this option, too? https://github.com/webpack-contrib/webpack-bundle-analyzer#options-for-plugin
It could be below the analyzerPort
value there.
Name:
analyzerUrl
Type:{function}
, called with{ listenHost: string, listenHost: string, boundAddress: server.address}
.server.address
comes from Node.js Default:http://${listenHost}:${boundAddress.port}
. The URL printed to console withserver
mode
Alright, it's my first time to contribute to this project and thanks for your guide.Thanks a lot :)
Thank you for your contributions ☺️ this PR seems good to go to me, hopefully it be useful to others, too ☺️
This has now been released in v4.6.0 ☺️
Sometimes,i will set host to be
0.0.0.0
,but i won't console info with0.0.0.0
.So i need to custom log info and show better info for users.