parcel-plugin-web-extension
parcel-plugin-web-extension copied to clipboard
Building for multiple targets
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
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?
It would be really useful. The #33 pull request already handles that. I hope it will be merged soon.
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.
@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.