-
Notifications
You must be signed in to change notification settings - Fork 33
Provide option to set toJson options #18
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
Comments
Hmm... Already you could do something like: var StatsWriterPlugin = require("webpack-stats-plugin").StatsWriterPlugin;
module.exports = {
plugins: [
new StatsWriterPlugin({
transform: function (data, opts) {
var stats = opts.compiler.getStats().toJson(/* YOUR OPTIONS */)
return DO_SOMETHING_WITH_CUSTOMIZED_STATS(stats);
}
})
]
}; to get you by, bypassing the But, I would potentially be open to a PR with an additional options field to punch into the |
Shoot, I didn't notice that the transform function provides the compiler. So yeah, this could work:
But it does require you to learn about An option to pass in the output options might look like this:
Webpack's docs/config uses the property |
Either way, thanks for the quick response! |
Yeah, I'd be open to a PR that adds a field |
When you generate stats with the Webpack CLI - it passes a particular set of "outputOptions" to
toJson()
. This results in different output than calling it without any options, which this plugin currently does.Providing the ability to pass the custom outputOptions into the
toJson()
call would allow users to customize the results, or make them match the default Webpack results.The text was updated successfully, but these errors were encountered: