Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Output --why webpack build for CI purposes #66

Open
jeffredodd opened this issue Jun 1, 2018 · 11 comments
Open

Output --why webpack build for CI purposes #66

jeffredodd opened this issue Jun 1, 2018 · 11 comments

Comments

@jeffredodd
Copy link

Hello,

As a user of CircleCI (or any other CI system), I would like to be able to store the output of the --why functionality in my build artifacts. This would allow me to use size limit to visually see what changed between builds, something that becomes rather complex over a large amount of commits.

If this is something that is possible I'd love to contribute.

Cheers,
Jeffrey

@ai
Copy link
Owner

ai commented Jun 1, 2018

Do I understand correctly that you want --why with custom webpack config?

In this case, just add Webpack Bundle Analyzer to your custom config.

Maybe we can do it automatically? Like changing webpack config in Size Limit. Do you want to send PR? (I am preparing for the conference and will be able to do it only in next week).

@jeffredodd
Copy link
Author

I guess i'm trying to understand where the build is being stored. If I could customize it using CLI I could then store it using CircleCI to define temp folders which are copied into my artifacts.

See documentation here. https://circleci.com/docs/2.0/artifacts/

I can try to get a PR up this weekend if this is something that would be useful for other consumers as well. 😄

@ai
Copy link
Owner

ai commented Jun 1, 2018

@jeffredodd Size Limit builds a project in memory. So you will not find it on the disk. Why do you need to find it?

@jeffredodd
Copy link
Author

jeffredodd commented Jun 1, 2018

@ai The purpose of this is to store the information on a per build basis. I work in a repository that receives a lot of internal contributions daily and we store our test coverage data in artifacts so we have a historical reference to the values at build time. This helps us during investigations say on why test coverage decreased, when, why it happened, etc.

We are hoping to do the same thing with SizeLimit, and by storing the output of --why would allow us to browse this information historical using the same tools versus pulling down a specific commit number and running it locally.

@ai
Copy link
Owner

ai commented Jun 1, 2018

@jeffredodd Got it. Do you want to store total bundle size or you want to store the whole --why tree?

@jeffredodd
Copy link
Author

Usually we store the whole webpack bundle or --why tree. I'll try to take a stab at it this weekend! Your feedback will be appreciated 😄.

@ai
Copy link
Owner

ai commented Jun 1, 2018

There are 2 options:

  1. You use custom webpack config, add Webpack Bundle Analyzer there with custom callback with stats data.
  2. You can add --why-stats path/to/file/to/save/stats option to Size Limit

@ai
Copy link
Owner

ai commented Jun 1, 2018

Do you have custom webpack config right now?

@eps1lon
Copy link

eps1lon commented Feb 18, 2019

@jeffredodd Sorry to bother you here but I didn't find any other way to contact you: What's your experience so far with using build artifacts for historical data?

The circle CI documentation says that there is no guarantee about storage duration and that artifacts should only be used around build time. I would like to use build artifacts for historical analysis of our builds but the statements on the documentation lead me to believe that they're not appropriate for those things.

There is a 3GB curl file size limit. Artifacts are designed to be useful around the time of the build. It is best practice not to rely on artifacts as a software distribution mechanism with long term future guarantees.
-- https://circleci.com/docs/2.0/artifacts/#artifacts-overview

@mflores-verys
Copy link

@ai

You can add --why-stats path/to/file/to/save/stats option to Size Limit

I wanted to confirm, does that option exist today or are you suggesting this would be a good capability for someone to add via PR?

@ai
Copy link
Owner

ai commented Jun 7, 2019

@mflores-verys sorry for the long delay. Had hard times because of the conference.

I wanted to confirm, does that option exist today or are you suggesting this would be a good capability for someone to add via PR?

Size Limit doesn’t have this option.

If you want to send PR, I will help you and accept it.

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

No branches or pull requests

4 participants