Skip to content

Conversation

@richerfu
Copy link
Contributor

Sometimes,i will set host to be 0.0.0.0,but i won't console info with 0.0.0.0.So i need to custom log info and show better info for users.

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Aug 16, 2022

CLA Signed

The committers listed above are authorized under a signed CLA.

@valscion
Copy link
Member

Hi, thanks for the pull request! How are you intending to use this change in your application?

@richerfu
Copy link
Contributor Author

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

@valscion
Copy link
Member

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:

#520 (comment)

@richerfu
Copy link
Contributor Author

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:

#520 (comment)

OK,i finished!

@valscion
Copy link
Member

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 with server mode

@richerfu
Copy link
Contributor Author

Alright, it's my first time to contribute to this project and thanks for your guide.Thanks a lot :)

@valscion
Copy link
Member

Thank you for your contributions ☺️ this PR seems good to go to me, hopefully it be useful to others, too ☺️

@valscion valscion merged commit 16d8e07 into webpack:master Aug 17, 2022
@valscion
Copy link
Member

This has now been released in v4.6.0 ☺️

crapStone pushed a commit to Calciumdibromid/CaBr2 that referenced this pull request Aug 23, 2022
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [webpack-bundle-analyzer](https://github.com/webpack-contrib/webpack-bundle-analyzer) | devDependencies | minor | [`4.5.0` -> `4.6.0`](https://renovatebot.com/diffs/npm/webpack-bundle-analyzer/4.5.0/4.6.0) |

---

### Release Notes

<details>
<summary>webpack-contrib/webpack-bundle-analyzer</summary>

### [`v4.6.0`](https://github.com/webpack-contrib/webpack-bundle-analyzer/blob/HEAD/CHANGELOG.md#&#8203;460)

[Compare Source](webpack/webpack-bundle-analyzer@v4.5.0...v4.6.0)

-   **New Feature**
    -   Support outputting different URL in server mode ([#&#8203;520](webpack/webpack-bundle-analyzer#520) by [@&#8203;southorange1228](https://github.com/southorange1228))
    -   Use deterministic chunk colors (#[501](webpack/webpack-bundle-analyzer#501) by [@&#8203;CreativeTechGuy](https://github.com/CreativeTechGuy))

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, click this checkbox.

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzMi4xNjUuMSIsInVwZGF0ZWRJblZlciI6IjMyLjE2NS4xIn0=-->

Co-authored-by: cabr2-bot <[email protected]>
Reviewed-on: https://codeberg.org/Calciumdibromid/CaBr2/pulls/1513
Reviewed-by: Epsilon_02 <[email protected]>
Co-authored-by: Calciumdibromid Bot <[email protected]>
Co-committed-by: Calciumdibromid Bot <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants