import 'systemjs/dist/system.js' // import 'systemjs/dist/extras/named-register.js' export interface ImportMap { resolutions?: Record imports?: Record scopes?: { [scope: string]: Record } integrity?: Record preload?: string[] prefetch?: string[] } type ISystem = typeof System & { onload?: ( error: Error | null | undefined, id: string, dependencies: string[], isErrorSource: boolean, ) => void addImportMap(map: ImportMap): void // from systemjs/dist/extras/named-register // registerRegistry: Record // namedRegisterAliases: Record } declare global { interface Window { System: ISystem } var importScripts: undefined | ((url: string) => Promise) } if (import.meta.env.DEV && typeof importScripts === 'function') { System.constructor.prototype.instantiate = async function (url: string) { await import(/* @vite-ignore */ url) return this.getRegister(url) } } export default System as ISystem