#dynamic imports

1 messages · Page 1 of 1 (latest)

keen silo
#

yo, any ways to perform this kind of imports ?

// index.ts
async function loader() {
      const module = await import('../modules/random')
      console.warn(module.test)
}

loader()
// ../modules/random.ts
export const test = 'test'

with others test i had this error : [Scripting][warning]-TypeError: toPrimitive

primal sleet
sinful wyvern
#

and I assume you are compiling your ts to js?

keen silo
#

Ye of course

#

So i'll wait then

hardy turret
#

I wasn't aware that the scripting API allowed dynamic imports.

#

When did they introduce dynamic importing?

stray vessel