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

web-extension polyfill not supported

Open varundey opened this issue 6 years ago • 2 comments

First of all thanks for this package. I have recently started with parcel and this plugin has been a lot of help.

Since I want my extension to have cross browser support, I am using web-extension polyfill in building my extension. I have added this polyfill in my manifest.json but parcel-web-ext transpiles it to to a parcelRequire function due to which this polyfill comes up as undefined in my extension. I was thinking if we could have a flag to avoid transpiling any such files inside a particular directory (say thirdparty in my case) and just copy them as such to destination directory.

varundey avatar May 06 '19 12:05 varundey

Any updates on this?

imedadel avatar Oct 06 '19 12:10 imedadel

In the mean time, you can simply do the following:

yarn add webextension-polyfill

and in your code

import browser from 'webextension-polyfill';

and use it from there!

ravern avatar Dec 02 '19 06:12 ravern