(path: string)
| 179 | // can be resolved properly. |
| 180 | let jiti: null | Jiti = null |
| 181 | async function importModule(path: string): Promise<any> { |
| 182 | if (typeof globalThis.__tw_load === 'function') { |
| 183 | let module = await globalThis.__tw_load(path) |
| 184 | if (module) { |
| 185 | return module |
| 186 | } |
| 187 | } |
| 188 | |
| 189 | try { |
| 190 | return await import(path) |
| 191 | } catch (error) { |
| 192 | jiti ??= createJiti(import.meta.url, { moduleCache: false, fsCache: false }) |
| 193 | return await jiti.import(path) |
| 194 | } |
| 195 | } |
| 196 | |
| 197 | const modules = [ |
| 198 | 'node_modules', |