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

kyt build and webpack json output #438

Open
AlgoTrader opened this issue Mar 13, 2017 · 5 comments
Open

kyt build and webpack json output #438

AlgoTrader opened this issue Mar 13, 2017 · 5 comments

Comments

@AlgoTrader
Copy link

webpack has --json option. KYT has no. I have to add those two lines to 'actions/build.js':

var fs = require('fs');
fs.writeFileSync('stats.json', JSON.stringify(stats.toJson(), null, 2))

to get webpack results in json. Is it possible to add kyt build --json filename option?

Are there any other ways to enable json output? I need it to analyze webpack bundle.

@delambo
Copy link
Member

delambo commented Mar 13, 2017

If we all agree that this would be a good product feature we could look into support for passing webpack cli options into thekyt build command but that looks like it would only solve half of your problem. We could also dump stats to the build artifact at build time. I'd have to think about what makes sense here.

@tizmagik
Copy link
Contributor

I think it's not just build artifacts, but also the Webpack build log itself that is useful, e.g. #349

@delambo
Copy link
Member

delambo commented Mar 13, 2017

@AlgoTrader what are you specifically looking for in the stats? How do you plan on parsing/using the data?

@AlgoTrader
Copy link
Author

The webpack json output is used by plenty of bundle analyzers/visualuzers.

It seems, there are plugins for webpack that generate json log, so patching kyt is not a must. But I certainly want more control on output options

@delambo
Copy link
Member

delambo commented Aug 11, 2017

@AlgoTrader - Have you tried webpack-stats-plugin or stats-webpack-plugin? They will emit a file and have a lot of options for configuring output. You can add them as plugins via the kyt.config.js callback, modifyWebpackConfig.

I'm going to close this for now. Let me know if my suggestion is unhelpful.

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

3 participants