mmktomato / parcel-plugin-web-ext-tool Goto Github PK
View Code? Open in Web Editor NEWA parcel plugin for web-ext.
License: MIT License
A parcel plugin for web-ext.
License: MIT License
The example setup has manifest.json
in the same directory as package.json
, so web-ext
finds it automatically. However, if the manifest is moved into a subdirectory extension
(and parcel’s output is directed there using -d extension/dist
), one would have to supply the sourceDir
option to web-ext
to ensure it finds it. I tried two approaches:
To try make this work, I added a line to package.json: "webExt": { "sourceDir": "extension" }
. This makes the extension work when run directly using npx web-ext run
(after running parcel build
). But this option seems to be ignored by parcel-plugin-web-ext-tool
, which only appears to load the config in webExt.run
.
I therefore tried moving the option there: "webExt": { "run": { "sourceDir": "extension" } }
. But this both appears to be invalid when invoking web-ext directly (unknown option: "sourceDir"
), and using parcel-plugin-web-ext-tool
still fails:
… installTemporaryAddon: Error: unknownError: Could not install add-on at './extension': [Exception... "Component returned failure code: 0x80520001 (NS_ERROR_FILE_UNRECOGNIZED_PATH) [nsIFile.initWithPath]" …
Any idea why this happens, or how to make it work when the extension lives in a subdirectory?
https://v2.parceljs.org/plugin-system/authoring-plugins/
Reporter
.
BuildSuccess
, BuildFailure
, WatchStart
, WatchEnd
?parcel-reporter-foobar
When trying to use the plugin with the newly released web-ext 5.0, the plugin fails with the following error:
> [email protected] watch /path/to/my/project/
> parcel watch ./src/test.ts --public-url ./
✨ Built in 897ms.
(node:27221) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'cmd' of undefined
at Bundler.<anonymous> (/path/to/my/project/node_modules/parcel-plugin-web-ext-tool/src/index.js:19:27)
(node:27221) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:27221) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
^C
Downgrading to web-ext 4.3.0 fixes the issue. Looking at the release notes for web-ext 5.0.0 it seems that their exports have changed.
Make sure these files works. Especially sourceDir
.
https://extensionworkshop.com/documentation/develop/getting-started-with-web-ext/#setting-option-defaults-in-a-configuration-file
https://extensionworkshop.com/documentation/develop/getting-started-with-web-ext/#automatic-discovery-of-configuration-files
Write it to README.
I guess the config files should not include noReload: false
because the plugin can't work file if it's false.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.