Commit 3ef7cd5 1 parent 3736dec commit 3ef7cd5 Copy full SHA for 3ef7cd5
File tree 4 files changed +14
-34
lines changed
packages/transport-bridge
4 files changed +14
-34
lines changed Original file line number Diff line number Diff line change 21
21
"devDependencies" : {
22
22
"@types/json-stable-stringify" : " ^1" ,
23
23
"esbuild" : " ^0.23.1" ,
24
+ "html-inline-script-webpack-plugin" : " ^3.2.1" ,
24
25
"html-webpack-plugin" : " ^5.6.0" ,
25
26
"pkg" : " ^5.8.1" ,
26
27
"webpack" : " ^5.97.1"
Original file line number Diff line number Diff line change @@ -441,38 +441,6 @@ export class TrezordNode {
441
441
} ,
442
442
] ) ;
443
443
444
- app . get ( '/ui' , [
445
- ( req , res ) => {
446
- const parsedUrl = new URL ( req . url , `http://${ req . headers . host } /` ) ;
447
-
448
- const pathname = path . join ( __dirname , this . assetPrefix , parsedUrl . pathname ) ;
449
-
450
- const map : Record < string , string > = {
451
- '.ico' : 'image/x-icon' ,
452
- '.html' : 'text/html' ,
453
- '.js' : 'text/javascript' ,
454
- '.json' : 'application/json' ,
455
- '.css' : 'text/css' ,
456
- '.png' : 'image/png' ,
457
- '.jpg' : 'image/jpeg' ,
458
- '.svg' : 'image/svg+xml' ,
459
- } ;
460
-
461
- const { ext } = path . parse ( pathname ) ;
462
- fs . stat ( pathname )
463
- . then ( ( ) => fs . readFile ( pathname ) )
464
- . then ( data => {
465
- res . setHeader ( 'Content-type' , map [ ext ] || 'text/plain' ) ;
466
- res . end ( data ) ;
467
- } )
468
- . catch ( err => {
469
- this . logger . error ( 'Failed to fetch UI' , err ) ;
470
- res . statusCode = 404 ;
471
- res . end ( `File ${ pathname } not found!` ) ;
472
- } ) ;
473
- } ,
474
- ] ) ;
475
-
476
444
app . get ( '/logs' , [
477
445
( _req , res ) => {
478
446
res . writeHead ( 200 , {
Original file line number Diff line number Diff line change
1
+ import HtmlInlineScriptPlugin from 'html-inline-script-webpack-plugin' ;
1
2
import HtmlWebpackPlugin from 'html-webpack-plugin' ;
2
3
import path from 'path' ;
3
4
import webpack from 'webpack' ;
@@ -62,10 +63,9 @@ const config: webpack.Configuration = {
62
63
plugins : [
63
64
new HtmlWebpackPlugin ( {
64
65
template : path . resolve ( __dirname , '../src/ui/index.html' ) ,
65
- filename : 'index.html' ,
66
66
inject : 'body' ,
67
- publicPath : 'http://127.0.0.1:21325/ui' ,
68
67
} ) ,
68
+ new HtmlInlineScriptPlugin ( ) ,
69
69
] ,
70
70
} ;
71
71
Original file line number Diff line number Diff line change @@ -12753,6 +12753,7 @@ __metadata:
12753
12753
"@trezor/utils": "workspace:*"
12754
12754
"@types/json-stable-stringify": "npm:^1"
12755
12755
esbuild: "npm:^0.23.1"
12756
+ html-inline-script-webpack-plugin: "npm:^3.2.1"
12756
12757
html-webpack-plugin: "npm:^5.6.0"
12757
12758
json-stable-stringify: "npm:^1.2.1"
12758
12759
pkg: "npm:^5.8.1"
@@ -25999,6 +26000,16 @@ __metadata:
25999
26000
languageName: node
26000
26001
linkType: hard
26001
26002
26003
+ "html-inline-script-webpack-plugin@npm:^3.2.1":
26004
+ version: 3.2.1
26005
+ resolution: "html-inline-script-webpack-plugin@npm:3.2.1"
26006
+ peerDependencies:
26007
+ html-webpack-plugin: ^5.0.0
26008
+ webpack: ^5.0.0
26009
+ checksum: 10/f7a67038ee89d6447a0389e92e565fcbe5482091d688096542304ee3d3a163aa3f2d7a725ee5a3eeda707913849cc0dbb2b6489d4fc190951a178492785ebbb5
26010
+ languageName: node
26011
+ linkType: hard
26012
+
26002
26013
"html-minifier-terser@npm:^6.0.2":
26003
26014
version: 6.1.0
26004
26015
resolution: "html-minifier-terser@npm:6.1.0"
You can’t perform that action at this time.
0 commit comments