Help creating a new reporter (Sonda integration) #10026
Unanswered
filipsobol
asked this question in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello 👋,
I'm the author of Sonda (https://sonda.dev/), a universal visualizer and analyzer for JavaScript and CSS bundles. Sonda currently works with most major bundlers, and I would like to add support for Parcel as well. I already have a working PoC (see the source code), but I found two blockers that I hope to get around with your help.
Issue 1: Loading configuration
The first issue has to do with loading the configuration. As far as I understand, plugins in Parcel do not accept configuration via constructor, so it has to be read from some file. Unfortunately, Reporters can't use the
loadConfig
function, and loading configuration in any other way may cause cache problems. Is there a workaround?Issue 2: Enforced package name
Parcel has a naming convention that integration authors should follow.
Currently, all Sonda integrations are named exports from a
sonda
package (SondaRollupPlugin
,SondaEsbuildPlugin
,SondaWebpackPlugin
). I'm fine with changing the API so that each integration has a unique import path (sonda/parcel
etc.). However, I don't want to go so far as to create a unique package for each integration, nor make an exception for Parcel (I want the same experience for all integrations).What I found is that using
sonda/parcel
with the CLI works fine (parcel build index.html --reporter sonda/parcel
. However, using the same name in.parcelrc
results in an error.results in:
Would it be possible to allow packages that do not follow the naming convention to be used in
.parcelrc
file too?Beta Was this translation helpful? Give feedback.
All reactions