parcel-plugin-web-extension icon indicating copy to clipboard operation
parcel-plugin-web-extension copied to clipboard

Building for multiple targets

Open tgroutars opened this issue 6 years ago • 4 comments

As there are a few minor differences between browsers (e.g. in the expected fields of manifest.json), I'm trying to get my project to create multiple builds. I was wondering how you would go about doing that.

One problem I encounter is that this plugin expects the file name to be exactly manifest.json. This means i need to put the different versions of the manifest (chrome, firefox, safari) in different folders. If I do this, parcel creates a folder named __ to support the fact I'm going up the directory tree to include my files. The only problem is the build doesn't work then, since apparently we can't use _ in filenames in an extension build.

Did you try this before, and how would you handle it? I wonder if it's something this plugin should support, or if that's something I should handle in my project

tgroutars avatar Dec 19 '18 10:12 tgroutars

One way of handling it would be to support manifest.chrome.json, manifest.firefox.json,... That said, this syntax is already used to support manifest.<NODE_ENV>.json so it might get confusing. @kevincharm What do you think?

tgroutars avatar Dec 19 '18 10:12 tgroutars

It would be really useful. The #33 pull request already handles that. I hope it will be merged soon.

Cl00e9ment avatar Jan 22 '20 21:01 Cl00e9ment

Since I really needed that feature, I made a fork and implemented a "dynamic manifest". Everything is explained in the README.md.

The module is available here. I could have made a simple pull request instead of another module, but it's not retro-compatible (because there is no more such thing as manifest overrides) so I think this is the correct way to do.

Cl00e9ment avatar Jan 27 '20 12:01 Cl00e9ment

@tgroutars @Cl00e9ment is this reeeeaallly needed? What changes do you need?

Chrome does complain about unrecognized fields, but it still works, and nobody else cares.

fregante avatar Apr 04 '20 17:04 fregante