ngx-builders / source-map-analyzer

typescript, builder
https://www.npmjs.com/package/@ngx-builders/analyze
MIT License
89 stars 12 forks source link

Documentation for --configuration #31

Closed JWess closed 4 years ago

JWess commented 4 years ago

In the README, --configuration is listed as an option. Could you describe how to use it? I would like to use source-map-explorer's --gzip option with this tool. Is that possible?

santoshyadavdev commented 4 years ago

HI @JWess , Thanks for pointing it out, to analyze the package we need it to be the production configuration, which is hard coded now https://github.com/ngx-builders/source-map-analyzer/blob/master/analyze/index.ts#L17 we will remove the configuration option to avoid confusion.

To use --gzip it will require an change in code base we will explore and make the changes.

DmitryEfimenko commented 4 years ago

I suggest leaving --configuration option in and actually making it work. Here's why: My prod configuration has budgets enabled with an option maximumError: "[n]kb". If I mess up and my bundle exceeds the error limit, the build for the "analyze" task fails, which does not make sense since this is the reason you're running analyze in the first place - to figure out why the bundle is too big. One way to avoid this is to create a separate config similar to prod but without budgets. If that's done, there's a need for a way to use that new build configuration.

santoshyadavdev commented 4 years ago

Sounds good @DmitryEfimenko , I think I can override the budgets in build. Let me check.