@@ -7,6 +7,7 @@ import type Serverless from 'serverless';
77import { IFramework } from './iFrameworks.js' ;
88import { LldConfigBase } from '../types/lldConfig.js' ;
99import { Logger } from '../logger.js' ;
10+ import { pathToFileURL } from 'url' ;
1011
1112/**
1213 * Support for Serverless Framework
@@ -285,51 +286,44 @@ async function loadFramework(npmName: string) {
285286 // lazy load modules
286287 const resolveConfigurationPath = (
287288 await import (
288- //@ts -ignore
289- `${ npmName } /lib/cli/resolve-configuration-path.js`
289+ pathToFileURL ( `${ npmName } /lib/cli/resolve-configuration-path.js` ) . href
290290 )
291291 ) . default ;
292292 const readConfiguration = (
293- await import (
294- //@ts -ignore
295- `${ npmName } /lib/configuration/read.js`
296- )
293+ await import ( pathToFileURL ( `${ npmName } /lib/configuration/read.js` ) . href )
297294 ) . default ;
298295 const resolveVariables = (
299296 await import (
300- //@ts -ignore
301- `${ npmName } /lib/configuration/variables/resolve.js`
297+ pathToFileURL ( `${ npmName } /lib/configuration/variables/resolve.js` ) . href
302298 )
303299 ) . default ;
304300 const resolveVariablesMeta = (
305301 await import (
306- // @ts -ignore
307- ` ${ npmName } /lib/configuration/variables/resolve-meta.js`
302+ pathToFileURL ( ` ${ npmName } /lib/configuration/variables/resolve-meta.js` )
303+ . href
308304 )
309305 ) . default ;
310306 const env = await import (
311- //@ts -ignore
312- `${ npmName } /lib/configuration/variables/sources/env.js`
307+ pathToFileURL ( `${ npmName } /lib/configuration/variables/sources/env.js` ) . href
313308 ) ;
314309 const file = await import (
315- //@ts -ignore
316- `${ npmName } /lib/configuration/variables/sources/file.js`
310+ pathToFileURL ( `${ npmName } /lib/configuration/variables/sources/file.js` ) . href
317311 ) ;
318312 const opt = await import (
319- //@ts -ignore
320- `${ npmName } /lib/configuration/variables/sources/opt.js`
313+ pathToFileURL ( `${ npmName } /lib/configuration/variables/sources/opt.js` ) . href
321314 ) ;
322315 const self = await import (
323- //@ts -ignore
324- `${ npmName } /lib/configuration/variables/sources/self.js`
316+ pathToFileURL ( `${ npmName } /lib/configuration/variables/sources/self.js` ) . href
325317 ) ;
326318 const strToBool = await import (
327- //@ts -ignore
328- `${ npmName } /lib/configuration/variables/sources/str-to-bool.js`
319+ pathToFileURL (
320+ `${ npmName } /lib/configuration/variables/sources/str-to-bool.js` ,
321+ ) . href
329322 ) ;
330323 const sls = await import (
331- //@ts -ignores
332- `${ npmName } /lib/configuration/variables/sources/instance-dependent/get-sls.js`
324+ pathToFileURL (
325+ `${ npmName } /lib/configuration/variables/sources/instance-dependent/get-sls.js` ,
326+ ) . href
333327 ) ;
334328
335329 const sources = {
@@ -341,7 +335,7 @@ async function loadFramework(npmName: string) {
341335 sls : sls . default ( ) ,
342336 } ;
343337
344- const Serverless = ( await import ( npmName ) ) . default ;
338+ const Serverless = ( await import ( pathToFileURL ( npmName ) . href ) ) . default ;
345339 return {
346340 resolveConfigurationPath,
347341 readConfiguration,
0 commit comments