File tree Expand file tree Collapse file tree 1 file changed +11
-4
lines changed
Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -163,13 +163,20 @@ export class BundleZipGenerator {
163163 } ,
164164 ] ;
165165 const addFile_DistToUsr = ( filepath : string , alias : string = filepath ) => {
166- console . log ( import . meta. resolve ( `../serve/${ filepath } ` ) ) ;
166+ const path = import . meta. resolve ( `../serve/${ filepath } ` ) ;
167+ let data = null ;
168+ // 如果是远程的
169+ if ( path . startsWith ( "http" ) ) {
170+ data = fs . readFileSync ( import . meta. resolve ( `../serve/${ filepath } ` ) ) ;
171+ } else {
172+ data = fs . readFileSync (
173+ fileURLToPath ( import . meta. resolve ( `../serve/${ filepath } ` ) )
174+ ) ;
175+ }
167176 entries . push ( {
168177 dir : false ,
169178 path : `usr/${ alias } ` ,
170- data : fs . readFileSync (
171- fileURLToPath ( import . meta. resolve ( `../serve/${ filepath } ` ) )
172- ) ,
179+ data : data ,
173180 } ) ;
174181 } ;
175182 if ( dev ) {
You can’t perform that action at this time.
0 commit comments