You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
after running the webpack --profile --json > dist/stats.json command the cli tool (webpack-bundle-analyzer dist/stats.json) throws an error:
Couldn't read webpack bundle stats from "[...]/dist/stats.json":
SyntaxError: Unexpected token [...] in JSON at position 0
the first 2 rows of the stats.json:
Webpack is in undefined mode.
warning: couldn't find native brotli support in zlib library. trying to fall back to iltorb.
first is a webpack warning because i didn't set the mode, the second is a warning from the brotli-webpack-plugin.
in my opinion having webpack info and warning messages are not uncommon so it would be great to find another way to save the stats.json instead of redirecting the output stream.
Technical info
Webpack Bundle Analyzer version: 3.3.2
Webpack version: 4.30.0
Node.js version: 10.15.3
npm/yarn version: 1.15.2
OS: macOS Mojave 10.14.4
Debug info
How do you use this module? As CLI utility or as plugin?
CLI: webpack-bundle-analyzer dist/stats.json
What other Webpack plugins were used?
html-webpack-plugin
compression-webpack-plugin
brotli-webpack-plugin
The text was updated successfully, but these errors were encountered:
There's the option of using this library as a plugin and supply generateStatsFile option to it.
The issue with:
Webpack is in undefined mode.
warning: couldn't find native brotli support in zlib library. trying to fall back to iltorb.
cannot be fixed by us, as it is some other tool that is outputting warnings into your standard output. The > character redirects all standard output to a file of your choosing.
With the --json flag, webpack should only output valid JSON — one that doesn't contain anything before the opening curly brace {.
Issue description
after running the
webpack --profile --json > dist/stats.json
command the cli tool (webpack-bundle-analyzer dist/stats.json
) throws an error:the first 2 rows of the stats.json:
first is a webpack warning because i didn't set the
mode
, the second is a warning from thebrotli-webpack-plugin
.in my opinion having webpack info and warning messages are not uncommon so it would be great to find another way to save the stats.json instead of redirecting the output stream.
Technical info
Debug info
How do you use this module? As CLI utility or as plugin?
CLI:
webpack-bundle-analyzer dist/stats.json
What other Webpack plugins were used?
The text was updated successfully, but these errors were encountered: