You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The declarativeNetRequest extension API requires that the developer define the Rulesets in the manifest.json. Each ruleset has a path property, which is "the path of the JSON ruleset relative to the extension directory." In other words, it's the path to a JSON file that needs to be copy over to the output directory when building the extension. Currently, this does not happen.
carterworks
changed the title
Parcel ignores declarative_net_request. rule_resources[].path json files in manifest.json
@parcel/transformers-webextension does not detect declarative_net_request. rule_resources[].path json files dependencies in manifest.json
Jun 2, 2022
🐛 bug report
The
declarativeNetRequest
extension API requires that the developer define the Rulesets in themanifest.json
. Each ruleset has apath
property, which is "the path of the JSON ruleset relative to the extension directory." In other words, it's the path to a JSON file that needs to be copy over to the output directory when building the extension. Currently, this does not happen.🎛 Configuration (.babelrc, package.json, cli command)
package.json
manifest.json
rules.json
🤔 Expected Behavior
The
rules.json
file should be copied to thedist/
folder when building the extension.😯 Current Behavior
rules.json
is not copied to thedist/
folder when building. This causes the extension to be invalid, when loaded unpacked into the browser.💁 Possible Solution
Fix
packages/transformers/webextension/src/WebExtensionTransformer.js
to pick up those json dependencies.Maybe something like this in
collectDependencies()
It should have more error checking, but this works. I'd make the PR myself, but I can't get my local parcel build environment to work correctly.
🔦 Context
I'm trying to create a Chrome web extension that uses the
declarativeNetRequest
API.🌍 Your Environment
The text was updated successfully, but these errors were encountered: