Skip to content

Building issues with @parcel/config-webextension if we use custom manifest file name #8404

@akash07k

Description

@akash07k

🐛 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:

{
	"extends": "@parcel/config-webextension"
}

🤔 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

"build-firefox": "parcel build src/manifest-firefox.json --no-content-hash --no-source-maps --dist-dir dist --no-cache --detailed-report 10"

🌍 Your Environment

Software Version(s)
Parcel 2.7.0
parcel/config-webextension 2.7.0
Node 2.7.0
npm/Yarn NPM 8.15.0
Operating System Windows 11

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions