Skip to content
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

Document changing the webextension manifest name #1052

Open
wants to merge 3 commits into
base: v2
Choose a base branch
from
Open

Conversation

mischnic
Copy link
Member

@mischnic mischnic commented Nov 1, 2022

No description provided.

@vercel
Copy link

vercel bot commented Nov 1, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
website ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 11, 2023 8:16am

Comment on lines +52 to +56
{% warning %}

With the default Web Extension config, the manifest has to be called `manifest.json` (and cannot be just any file with a `json` extension).

{% endwarning %}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the first actual change.

Comment on lines +72 to +90
To make Parcel treat some other file as a manifest apart from `manifest.json`, add a few more lines to the `.parcelrc`:

{% sample %}
{% samplefile ".parcelrc" %}

```json
{
"extends": "@parcel/config-webextension",
"transformers": {
"some-other-manifest.json": ["@parcel/transformer-webextension"]
},
"packagers": {
"some-other-manifest.json": "@parcel/packager-webextension"
}
}
```

{% endsamplefile %}
{% endsample %}
Copy link
Member Author

@mischnic mischnic Nov 1, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the other change, everything else was caused by Prettier for some reason.

@akash07k
Copy link

akash07k commented Nov 1, 2022

Seems fine for now, however, actual flexibility of having any file name for the manifest will be very much helpful in future.

@mischnic
Copy link
Member Author

Turns out this actually doesn't work yet because of this hardcoded name check:
https://github.com/parcel-bundler/parcel/blob/c3bbe0a6160186f496ca2f9e9bead9376c0522f1/packages/runtimes/webextension/src/WebExtensionRuntime.js#L18
We'll have to change that to just rely on some asset meta property...

@akash07k
Copy link

akash07k commented Nov 12, 2022 via email

@kuroppe1819
Copy link

If you stop hard-coding and rely on meta property, the build will go through. However, since the output file name remains the same, it cannot be loaded as a browser extension. I want to convert the file name to manifest.json when outputting, but I can't think of a good way to do it...😞. Do you have any good ideas?

@sergey-shpak
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants