The previous approach (source .env && npm run sign:firefox) failed because npm subshells don't inherit env vars consistently, and quoted values in .env weren't being stripped. New approach: sign-firefox.sh reads .env itself, strips quotes, and passes --api-key/--api-secret directly to web-ext sign. Also renames web-ext-config.js → web-ext-config.cjs to fix the deprecation warning, and bumps package.json version to 0.2.0. https://claude.ai/code/session_01Dvgwe7XMoSxnWXkih8p1Cw
35 lines
960 B
JavaScript
35 lines
960 B
JavaScript
/**
|
|
* web-ext configuration for Firefox extension development.
|
|
*
|
|
* For signing, you need a Mozilla API key and secret.
|
|
* Get them at: https://addons.mozilla.org/developers/addon/api/key/
|
|
*
|
|
* Set these environment variables before running `npm run sign:firefox`:
|
|
* export WEB_EXT_API_KEY="user:12345:678"
|
|
* export WEB_EXT_API_SECRET="your-secret-here"
|
|
*
|
|
* Or create a .env file (git-ignored) and source it:
|
|
* source .env && npm run sign:firefox
|
|
*/
|
|
|
|
module.exports = {
|
|
sourceDir: 'dist/firefox',
|
|
artifactsDir: 'dist/firefox-signed',
|
|
ignoreFiles: [
|
|
'generate-icons.html',
|
|
],
|
|
build: {
|
|
overwriteDest: true,
|
|
},
|
|
run: {
|
|
startUrl: ['https://claude.ai/'],
|
|
// Firefox Developer Edition or Nightly recommended for MV3
|
|
// firefox: '/path/to/firefox-developer-edition',
|
|
},
|
|
sign: {
|
|
channel: 'unlisted',
|
|
// API credentials come from environment variables:
|
|
// WEB_EXT_API_KEY and WEB_EXT_API_SECRET
|
|
},
|
|
};
|