Skip to content

Commit 4a64b8a

Browse files
committed
fix signing
1 parent 75d2984 commit 4a64b8a

File tree

3 files changed

+12
-9
lines changed

3 files changed

+12
-9
lines changed

addon/.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
11
*.js
2+
*.js.*
3+
web-ext-artifacts/

package.json

+6-5
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,12 @@
55
"main": "index.js",
66
"scripts": {
77
"test": "echo \"Error: no test specified\" && exit 1",
8-
"build:js": "webpack",
9-
"build:unsigned:ext": "cd addon && web-ext build",
10-
"build:signed:ext": "cd addon && web-ext build",
11-
"build:unsigned": "npm run build:js && npm run build:unsigned:ext",
12-
"build:signed": "npm run build:js && npm run build:signed:ext",
8+
"build:dev:js": "webpack",
9+
"build:prod:js": "webpack --env production",
10+
"build:unsigned:ext": "cd addon && web-ext build --overwrite-dest",
11+
"build:signed:ext": "cd addon && web-ext sign",
12+
"build:unsigned": "npm run build:dev:js && npm run build:unsigned:ext",
13+
"build:signed": "npm run build:prod:js && npm run build:signed:ext",
1314
"build": "npm run build:unsigned",
1415
"start": "webpack watch"
1516
},

webpack.config.mjs

+4-4
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ import WebExtWebpackPlugin from '@leo60228/web-ext-webpack-plugin';
55
const cwd = dirname(fileURLToPath(import.meta.url));
66
const addonDir = resolve(cwd, 'addon');
77

8-
const config = {
9-
mode: 'development',
10-
devtool: 'eval-source-map',
8+
const config = env => ({
9+
mode: env.production ? 'production' : 'development',
10+
devtool: env.production ? 'source-map' : 'eval-source-map',
1111
entry: {
1212
content_script: './lib/content.js',
1313
},
@@ -23,6 +23,6 @@ const config = {
2323
keepProfileChanges: true
2424
})
2525
]
26-
};
26+
});
2727

2828
export default config;

0 commit comments

Comments
 (0)