parcel-plugin-bundle-visualiser
parcel-plugin-bundle-visualiser copied to clipboard
Incompatible with Parcel v2 ?
It seems that this plugin no longer works after upgrading to the new Parcel v2; the report.html
file is no longer generated.
There is a Parcel 2 core plugin that is included by default and can be enabled by setting an env-variable: ~PARCEL_BUNDLE_ANALZYZER=1 parcel build ...
~
PARCEL_BUNDLE_ANALYZER =1 parcel build ...
(https://github.com/parcel-bundler/parcel/tree/v2/packages/reporters/bundle-analyzer)
This doesn't seem to output anything for some reason, can't find any documentation for it either.
https://v2.parceljs.org/features/production/
fwiw there's a typo in the above command if anyone missed that as i did
PARCEL_BUNDLE_ANALYZER=1 parcel build
For anyone encountering this with the latest Parcel 2 beta versions (or newer), the new way to call the built-in Parcel 2 Bundle Analyzer is:
parcel build src/index.html --reporter @parcel/reporter-bundle-analyzer
PARCEL_BUNDLE_ANALYZER=1
also needs to be set, so consider:
cross-env PARCEL_BUNDLE_ANALYZER=1 parcel build src/index.html --reporter @parcel/reporter-bundle-analyzer
(as seen in the docs at https://v2.parceljs.org/features/production/)
After upgrading to latest parcel version, I get: The plugin "@parcel/reporter-bundle-analyzer" is not compatible with the current version of Parcel. Requires "^2.8.3" but the current version is "2.0.0-nightly.1293
My versions:
"@parcel/reporter-bundle-analyzer": "^2.8.3", "parcel": "^2.0.0-nightly.1293",
Shouldn't it work anyway?
@parcel/reporter-bundle-analyzer is not this repo, it's an official plugin: https://github.com/parcel-bundler/parcel/tree/v2/packages/reporters/bundle-analyzer
And this is unfortunately what the semver rules are: https://jubianchi.github.io/semver-check/#/^2.8.3/2.0.0-nightly.1293
You should instead install the nightly for both: yarn add parcel@nightly @parcel/reporter-bundle-analyzer@nightly
Thanks, it worked!
Oh, sorry, I didn't realize it's a different repo, got here by Googling the error.