Closed Katerina198b closed 1 year ago
Hi! Thanks for adding all this context to the issue description ☺️
I think, but haven't confirmed, that the way you're trying to do this with outputting the stats.json should work.
Looking at the error you have:
Couldn't read webpack bundle stats from "../build/stats.json": SyntaxError: Unexpected token > in JSON at position 1
it looks like the ../build/stats.json
file starts with something that isn't JSON.
Maybe that file contains some extra output before the stats JSON itself? I wonder if:
npm run build:webpack -- --profile --json
outputs something in the beginning before the JSON itself and that will in turn get stored to the build/stats.json
file.
It seems that the --json
option when given to webpack CLI will directly support passing the file as a path for the output file: https://webpack.js.org/api/cli/#json
Can you test if this would work?
build:webpack: webpack --config ./configuration/webpack.config.js,
npm run build:webpack -- --profile --json build/stats.json
I'm going to close this as I haven't heard back from you. We can reopen if there indeed is something that is not working as expected ☺️
Issue description
I use multiple webpack configurations for my component library. It means I have a bundle for each component. I want to see an overall picture of bundle side for all of that components in one place. For now, I've found only one opportunity to open BundleAnalyzer for each component
Question: Is it possible to join all outputs (for each component) into one stats.json (or host it in one place)? For now, I have:
Technical info
Debug info
How do you use this module? As CLI utility or as plugin? - I'm trying both
CLI
plugin