File tree 3 files changed +12
-9
lines changed
3 files changed +12
-9
lines changed Original file line number Diff line number Diff line change 1
1
* .js
2
+ * .js. *
3
+ web-ext-artifacts /
Original file line number Diff line number Diff line change 5
5
"main" : " index.js" ,
6
6
"scripts" : {
7
7
"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" ,
13
14
"build" : " npm run build:unsigned" ,
14
15
"start" : " webpack watch"
15
16
},
Original file line number Diff line number Diff line change @@ -5,9 +5,9 @@ import WebExtWebpackPlugin from '@leo60228/web-ext-webpack-plugin';
5
5
const cwd = dirname ( fileURLToPath ( import . meta. url ) ) ;
6
6
const addonDir = resolve ( cwd , 'addon' ) ;
7
7
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' ,
11
11
entry : {
12
12
content_script : './lib/content.js' ,
13
13
} ,
@@ -23,6 +23,6 @@ const config = {
23
23
keepProfileChanges : true
24
24
} )
25
25
]
26
- } ;
26
+ } ) ;
27
27
28
28
export default config ;
You can’t perform that action at this time.
0 commit comments