-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Building issues with @parcel/config-webextension if we use custom manifest file name #8404
Comments
parcel/packages/configs/webextension/index.json Lines 3 to 10 in cbc84b0
But I think it's easier to create |
@fregante Now I was unable to reference my scripts and was getting errors if I was using the syntax like: |
@fregante |
@fregante |
@fregante @akash07k as far as I can understand there is a misunderstanding in implicit knowledge on how to use @parcel/config-webextension. |
@piotrwitek Yes, you are quite right. |
Since the driver behind this seems to be the need to support two different manifest versions because of the Chrome Store MV3 fiasco, I was wondering if a useful feature might be a transformer that parses some sort of primary manifest file (which could be in JS or JSON5) and cooks it into the appropriate MV2 / MV3 format JSON manifest, depending on which parcel config file we use. Wins:
|
@akash07k How did you solve the issue with relative scripts and locales? The problem I'm facing now, if I create separate manifests, e.g. |
@everdimension |
Does this resolve everyone's concerns regarding different filenames for the manifest? |
@mischnic |
Not stail |
+ Added support for chrome + Changes for manifest V3 = bgScript URLSearchParams was replaced with URL due to USP not working in Chrome MV3 = setBadgeText was separated into new function because browserAction was renamed to action in MV3 = Firefox remains on V2 because of the green dot permissions issue https://bugzilla.mozilla.org/show_bug.cgi?id=1851083 = Manifests have been given separate folder due to parcel issue parcel-bundler/parcel#8404 = Replaced @types/firefox-webext-browser with @types/webextension-polyfill as they both provide the same types & webextension-polyfill is in use for cross-browser compatibility of the Browser namespace
🐛 bug report
I'm building a web extension and I have separate manifests for both Chrome and Firefox.
Let's say my manifest is named
manifest-firefox.json
So, if I try to build my extension by using
parcel build src/manifest-firefox.json
then it doesn't build the extension and doesn't even throw an error.When I check the dist directory, I see that it has created only 1 file called:
manifest-firefox.js
Whereas if I rename the original manifest file to "manifest.json" and use the command like:
parcel build src/manifest.json
Then it successfully builds the extension. (PS: Manifest is unchanged in both the scenarios, only the file is renamed nothing else.)
So it seems that parcel has some bug where it doesn't work with custom named manifests.
🎛 Configuration (.babelrc, package.json, cli command)
I'm not using any babel config.
My .parcelrc is below:
🤔 Expected Behavior
Extension should be built correctly even though we supply custom manifest file name
😯 Current Behavior
The extension didn't built properly and I got only 1 file in dist directory named
manifest-firefox.js
with contents:JSON.parse('{"//My manifest json here"}
💁 Possible Solution
🔦 Context
Trying to build extension for chrome and firefox with separate manifests
💻 Code Sample
🌍 Your Environment
The text was updated successfully, but these errors were encountered: