File tree Expand file tree Collapse file tree 5 files changed +66
-3
lines changed
apps/browser-extension-wallet Expand file tree Collapse file tree 5 files changed +66
-3
lines changed Original file line number Diff line number Diff line change 27
27
"scripts" : {
28
28
"build" : " run-s cleanup:dist build:project" ,
29
29
"build:app" : " NODE_OPTIONS='--openssl-legacy-provider' run -T webpack --config webpack.app.${WEBPACK_ENV:-prod}.js --progress" ,
30
+ "build:cs" : " NODE_OPTIONS='--openssl-legacy-provider' run -T webpack --config webpack.cs.${WEBPACK_ENV:-prod}.js --progress" ,
30
31
"build:dev" : " WEBPACK_ENV=dev yarn build" ,
31
32
"build:firefox" : " BROWSER=firefox yarn build" ,
32
33
"build:firefox:dev" : " WEBPACK_ENV=dev yarn build:firefox" ,
33
- "build:project" : " run-p build:sw build:app" ,
34
+ "build:project" : " run-p build:sw build:app build:cs " ,
34
35
"build:sw" : " NODE_OPTIONS='--openssl-legacy-provider' run -T webpack --config webpack.sw.${WEBPACK_ENV:-prod}.js --progress" ,
35
36
"cleanup" : " run-p cleanup:*" ,
36
37
"cleanup:dist" : " rm -rf dist" ,
Original file line number Diff line number Diff line change @@ -26,8 +26,6 @@ module.exports = () =>
26
26
entry : {
27
27
popup : withMaybeSentry ( path . join ( __dirname , 'src/index-popup.tsx' ) ) ,
28
28
options : withMaybeSentry ( path . join ( __dirname , 'src/index-options.tsx' ) ) ,
29
- content : path . join ( __dirname , 'src/lib/scripts/background/content.ts' ) ,
30
- inject : path . join ( __dirname , 'src/lib/scripts/background/inject.ts' ) ,
31
29
dappConnector : withMaybeSentry ( path . join ( __dirname , 'src/index-dapp-connector.tsx' ) ) ,
32
30
[ 'trezor-content-script' ] : path . join ( __dirname , 'src/lib/scripts/trezor/trezor-content-script.ts' ) ,
33
31
[ 'trezor-usb-permissions' ] : withMaybeSentry (
Original file line number Diff line number Diff line change
1
+ const path = require ( 'path' ) ;
2
+ const { merge } = require ( 'webpack-merge' ) ;
3
+ const commonConfig = require ( './webpack.common' ) ;
4
+
5
+ require ( 'dotenv-defaults' ) . config ( {
6
+ path : './.env' ,
7
+ encoding : 'utf8' ,
8
+ defaults : process . env . BUILD_DEV_PREVIEW === 'true' ? './.env.developerpreview' : './.env.defaults'
9
+ } ) ;
10
+
11
+ module . exports = ( ) =>
12
+ merge ( commonConfig ( ) , {
13
+ entry : {
14
+ content : path . join ( __dirname , 'src/lib/scripts/background/content.ts' ) ,
15
+ inject : path . join ( __dirname , 'src/lib/scripts/background/inject.ts' )
16
+ } ,
17
+ output : {
18
+ path : path . join ( __dirname , 'dist/app' ) ,
19
+ filename : '[name].js' ,
20
+ // the following setting is required for SRI to work:
21
+ crossOriginLoading : 'anonymous'
22
+ } ,
23
+ experiments : {
24
+ syncWebAssembly : true
25
+ }
26
+ } ) ;
Original file line number Diff line number Diff line change
1
+ const { merge } = require ( 'webpack-merge' ) ;
2
+
3
+ const commonDevConfig = require ( './webpack.common.dev' ) ;
4
+ const commonCsConfig = require ( './webpack.common.cs' ) ;
5
+ require ( 'dotenv-defaults' ) . config ( {
6
+ path : './.env' ,
7
+ encoding : 'utf8' ,
8
+ defaults : process . env . BUILD_DEV_PREVIEW === 'true' ? './.env.developerpreview' : './.env.defaults'
9
+ } ) ;
10
+
11
+ module . exports = ( env ) => merge ( commonDevConfig ( { devServerPort : 3001 } ) ( env ) , commonCsConfig ( ) ) ;
Original file line number Diff line number Diff line change
1
+ const { merge } = require ( 'webpack-merge' ) ;
2
+ const commonProdConfig = require ( './webpack.common.prod' ) ;
3
+ const commonCsConfig = require ( './webpack.common.cs' ) ;
4
+
5
+ require ( 'dotenv-defaults' ) . config ( {
6
+ path : './.env' ,
7
+ encoding : 'utf8' ,
8
+ defaults : process . env . BUILD_DEV_PREVIEW === 'true' ? './.env.developerpreview' : './.env.defaults'
9
+ } ) ;
10
+
11
+ module . exports = ( ) =>
12
+ merge ( commonProdConfig ( ) , commonCsConfig ( ) , {
13
+ optimization : {
14
+ splitChunks : {
15
+ maxSize : 4000000 ,
16
+ cacheGroups : {
17
+ vendors : {
18
+ test : / [ / \\ ] n o d e _ m o d u l e s [ / \\ ] / ,
19
+ enforce : true ,
20
+ priority : - 20 ,
21
+ chunks : 'async' ,
22
+ reuseExistingChunk : true
23
+ }
24
+ }
25
+ }
26
+ }
27
+ } ) ;
You can’t perform that action at this time.
0 commit comments