Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Override analyzerMode via environment variable#614

dleavitt started this conversation inIdeas
Discussion options

Issue description

By default, webpack bundle analyzer starts a server, which means that the webpack process will never terminate.

This is undesirable in CI and other non-interactive environments - your jobs will hang indefinitely. Currently (as far as I can tell) there's no way to prevent this from happening without changing the webpack configuration code. This isn't always possible in CI (e.g. it's someone else's code, or it's an older version of your own code prior to the configuration change.)

It would be great if there was some way to override theanalyzerMode setting from the command-line, e.g.WEBPACK_BUNDLE_ANALYZER_MODE=json which could be set in non-interactive environments to ensure that the process will never hang.

Happy to submit a PR if this sounds useful.

Technical info

  System:    OS: macOS 11.5.2    CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz    Memory: 260.25 MB / 16.00 GB    Shell: 5.8 - /bin/zsh  Binaries:    Node: 16.14.0 - ~/.nodenv/versions/16.14.0/bin/node    Yarn: 1.22.17 - /usr/local/bin/yarn    npm: 8.3.1 - ~/.nodenv/versions/16.14.0/bin/npm  npmPackages:    compression-webpack-plugin: ^10.0.0 => 10.0.0     css-minimizer-webpack-plugin: ^4.2.2 => 4.2.2     fork-ts-checker-webpack-plugin: ^8.0.0 => 8.0.0     terser-webpack-plugin: 5 => 5.3.7     webpack: 5 => 5.82.0     webpack-assets-manifest: 5 => 5.1.0     webpack-bundle-analyzer: ^4.5.0 => 4.8.0     webpack-cli: 5 => 5.0.2     webpack-dev-server: ^4.7.4 => 4.13.3     webpack-merge: 5 => 5.8.0
You must be logged in to vote

Replies: 1 comment 3 replies

Comment options

Hi! Thanks for the the suggestion. I think it's out of scope forwebpack-bundle-analyzer to start using environment variables to pick option values but if there's a lot of need for this from others, then I might be persuaded otherwise.

If we'd go with adding environment variables support, I'd hope we'd do it for all possible options and not only theanalyzerMode one.

You must be logged in to vote
3 replies
@dleavitt
Comment options

Thanks@valscion, makes sense.

My inspiration was the documentation for this 1st-party Github action, which I believe will just hang:
https://github.com/github/webpack-bundlesize-compare-action#how-to-use-it

I left them a note about it here:
github/webpack-bundlesize-compare-action#499
Does that note seem accurate?

@valscion
Comment options

I've never usedhttps://github.com/github/webpack-bundlesize-compare-action myself but it does look like they could do with using the--json flag and not usewebpack-bundle-analyzer at all. But I might be missing something.

@cmaitrepierre
Comment options

I think the same as Daniel Leavitt. As we want to replace Unit Test (karma depracated now) by Cypress component, is it very important to run the Component Testing (CT) in our CI (Gitlab) for the development target. This infinite loop can be break by gitlab : variables:
RUNNER_SCRIPT_TIMEOUT: 5m but tests not performed and no report generated.

imageimage
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Category
Ideas
Labels
None yet
3 participants
@dleavitt@valscion@cmaitrepierre
Converted from issue

This discussion was converted from issue #613 on September 24, 2023 06:03.


[8]ページ先頭

©2009-2025 Movatter.jp