@@ -8,7 +8,7 @@ var webpack = require('webpack'),
88  TerserPlugin  =  require ( 'terser-webpack-plugin' ) , 
99  NodePolyfillPlugin  =  require ( 'node-polyfill-webpack-plugin' ) , 
1010  ReactRefreshWebpackPlugin  =  require ( '@pmmmwh/react-refresh-webpack-plugin' ) ; 
11- const  {  sentryWebpackPlugin }  =  require ( " @sentry/webpack-plugin" ) ; 
11+ const  {  sentryWebpackPlugin }  =  require ( ' @sentry/webpack-plugin' ) ; 
1212
1313require ( 'dotenv' ) . config ( ) ; 
1414
@@ -21,7 +21,7 @@ var secretsPath = path.join(__dirname, 'secrets.' + env.NODE_ENV + '.js');
2121
2222require ( 'dotenv-defaults' ) . config ( { 
2323  path : './.env' , 
24-   encoding : 'utf8' 
24+   encoding : 'utf8' , 
2525} ) ; 
2626
2727var  fileExtensions  =  [ 
@@ -44,14 +44,17 @@ if (fileSystem.existsSync(secretsPath)) {
4444const  isDevelopment  =  process . env . NODE_ENV  ===  'development' ; 
4545
4646const  hasSentryConfig  = 
47-      ! ! process . env . SENTRY_AUTH_TOKEN  && 
48-      ! ! process . env . SENTRY_ORG  && 
49-      ! ! process . env . SENTRY_PROJECT  && 
50-      ! ! process . env . SENTRY_DSN 
47+   ! ! process . env . SENTRY_AUTH_TOKEN  && 
48+   ! ! process . env . SENTRY_ORG  && 
49+   ! ! process . env . SENTRY_PROJECT  && 
50+   ! ! process . env . SENTRY_DSN ; 
5151
52- const  withMaybeSentry  =  ( p )  =>  hasSentryConfig  ? [  path . join ( __dirname ,  'src' ,  'features' ,  'sentry.js' ) ,  p  ]  : p ; 
52+ const  withMaybeSentry  =  ( p )  => 
53+   hasSentryConfig 
54+     ? [ path . join ( __dirname ,  'src' ,  'features' ,  'sentry.js' ) ,  p ] 
55+     : p ; 
5356
54- const  envsToExpose  =  [ 'NODE_ENV' ,   'LACE_EXTENSION_ID' ,   'NAMI_EXTENSION_ID' ] ; 
57+ const  envsToExpose  =  [ 'NODE_ENV' ] ; 
5558if  ( hasSentryConfig )  envsToExpose . push ( 'SENTRY_DSN' ) ; 
5659
5760var  options  =  { 
@@ -61,28 +64,31 @@ var options = {
6164  } , 
6265  mode : process . env . NODE_ENV  ||  'development' , 
6366  entry : { 
64-     mainPopup : withMaybeSentry ( path . join ( __dirname ,  'src' ,  'ui' ,  'indexMain.jsx' ) ) , 
65-     internalPopup : withMaybeSentry ( path . join ( __dirname ,  'src' ,  'ui' ,  'indexInternal.jsx' ) ) , 
66-     hwTab : withMaybeSentry ( path . join ( __dirname ,  'src' ,  'ui' ,  'app' ,  'tabs' ,  'hw.jsx' ) ) , 
67-     createWalletTab : withMaybeSentry ( path . join ( 
68-       __dirname , 
69-       'src' , 
70-       'ui' , 
71-       'app' , 
72-       'tabs' , 
73-       'createWallet.jsx' 
74-     ) ) , 
75-     trezorTx : withMaybeSentry ( path . join ( __dirname ,  'src' ,  'ui' ,  'app' ,  'tabs' ,  'trezorTx.jsx' ) ) , 
76-     background : withMaybeSentry ( path . join ( __dirname ,  'src' ,  'pages' ,  'Background' ,  'index.js' ) ) , 
77-     contentScript : withMaybeSentry ( path . join ( __dirname ,  'src' ,  'pages' ,  'Content' ,  'index.js' ) ) , 
78-     injected : withMaybeSentry ( path . join ( __dirname ,  'src' ,  'pages' ,  'Content' ,  'injected.js' ) ) , 
79-     trezorContentScript : withMaybeSentry ( path . join ( 
80-       __dirname , 
81-       'src' , 
82-       'pages' , 
83-       'Content' , 
84-       'trezorContentScript.js' 
85-     ) ) 
67+     mainPopup : withMaybeSentry ( 
68+       path . join ( __dirname ,  'src' ,  'ui' ,  'indexMain.jsx' ) 
69+     ) , 
70+     internalPopup : withMaybeSentry ( 
71+       path . join ( __dirname ,  'src' ,  'ui' ,  'indexInternal.jsx' ) 
72+     ) , 
73+     hwTab : withMaybeSentry ( 
74+       path . join ( __dirname ,  'src' ,  'ui' ,  'app' ,  'tabs' ,  'hw.jsx' ) 
75+     ) , 
76+     createWalletTab : withMaybeSentry ( 
77+       path . join ( __dirname ,  'src' ,  'ui' ,  'app' ,  'tabs' ,  'createWallet.jsx' ) 
78+     ) , 
79+     trezorTx : withMaybeSentry ( 
80+       path . join ( __dirname ,  'src' ,  'ui' ,  'app' ,  'tabs' ,  'trezorTx.jsx' ) 
81+     ) , 
82+     background : path . join ( __dirname ,  'src' ,  'pages' ,  'Background' ,  'index.js' ) , 
83+     contentScript : withMaybeSentry ( 
84+       path . join ( __dirname ,  'src' ,  'pages' ,  'Content' ,  'index.js' ) 
85+     ) , 
86+     injected : withMaybeSentry ( 
87+       path . join ( __dirname ,  'src' ,  'pages' ,  'Content' ,  'injected.js' ) 
88+     ) , 
89+     trezorContentScript : withMaybeSentry ( 
90+       path . join ( __dirname ,  'src' ,  'pages' ,  'Content' ,  'trezorContentScript.js' ) 
91+     ) , 
8692  } , 
8793  chromeExtensionBoilerplate : { 
8894    notHotReload : [ 'contentScript' ,  'devtools' ,  'injected' ] , 
@@ -193,13 +199,19 @@ var options = {
193199  } , 
194200  plugins : [ 
195201    ...( isDevelopment  ? [ new  ReactRefreshWebpackPlugin ( ) ]  : [ ] ) , 
196-     ...( hasSentryConfig  ? [ sentryWebpackPlugin ( { 
197-       authToken : process . env . SENTRY_AUTH_TOKEN , 
198-       org : process . env . SENTRY_ORG , 
199-       project : process . env . SENTRY_PROJECT , 
200-       telemetry : false , 
201-       url : 'https://sentry.io/' 
202-     } ) ]  : [ ] ) , 
202+     ...( hasSentryConfig 
203+       ? [ 
204+           sentryWebpackPlugin ( { 
205+             authToken : process . env . SENTRY_AUTH_TOKEN , 
206+             org : process . env . SENTRY_ORG , 
207+             project : process . env . SENTRY_PROJECT , 
208+             telemetry : false , 
209+             include : './build' , 
210+             url : 'https://sentry.io/' , 
211+             ignore : [ 'node_modules' ,  'webpack.config.js' ] , 
212+           } ) , 
213+         ] 
214+       : [ ] ) , 
203215    new  webpack . BannerPlugin ( { 
204216      banner : ( )  =>  { 
205217        return  'globalThis.document={getElementsByTagName:()=>[],createElement:()=>({ setAttribute:()=>{}}),head:{appendChild:()=>{}}};' ; 
0 commit comments