1+ import path from 'node:path' ;
2+ import url from 'node:url' ;
3+
14import {
25 baseTempDir ,
36 debug ,
@@ -12,7 +15,6 @@ import fs from 'graceful-fs';
1215import { promisifiedGracefulFs } from './util.js' ;
1316import { getMetadataFromPackageJSON } from './infer.js' ;
1417import { runHooks } from './hooks.js' ;
15- import path from 'node:path' ;
1618import {
1719 createPlatformArchPairs ,
1820 osModules ,
@@ -28,7 +30,6 @@ import type {
2830 Options ,
2931 ProcessedOptions ,
3032} from './types.js' ;
31- import { App } from './platform.js' ;
3233
3334async function debugHostInfo ( ) {
3435 debug ( await hostInfo ( ) ) ;
@@ -192,10 +193,16 @@ export class Packager {
192193 debug ( `Creating ${ buildDir } ` ) ;
193194 await fs . promises . mkdir ( buildDir , { recursive : true } ) ;
194195 await this . extractElectronZip ( comboOpts , zipPath , buildDir ) ;
195- const os = await import (
196- `${ osModules [ comboOpts . platform as OfficialPlatform ] } .js`
197- ) ;
198- const app = new os . App ( comboOpts , buildDir ) as App ;
196+ const osPackagerPath = url
197+ . pathToFileURL (
198+ path . resolve (
199+ import . meta. dirname ,
200+ `${ osModules [ comboOpts . platform ] } .js` ,
201+ ) ,
202+ )
203+ . toString ( ) ;
204+ const osPackager = await import ( osPackagerPath ) ;
205+ const app = new osPackager . App ( comboOpts , buildDir ) ;
199206 return app . create ( ) ;
200207 }
201208
0 commit comments