Skip to content

Commit

Permalink
fix: cannot get ts module in prod env
Browse files Browse the repository at this point in the history
  • Loading branch information
johnsoncodehk committed Jul 5, 2023
1 parent f5ddb38 commit 0cc220d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/monaco/vue.worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ async function importTsFromCdn(tsVersion: string) {
;(globalThis as any).module = { exports: {} }
const tsUrl = `https://cdn.jsdelivr.net/npm/typescript@${tsVersion}/lib/typescript.js`
await import(/* @vite-ignore */ tsUrl)
const ts = module.exports
const ts = globalThis.module.exports
globalThis.module = _module
return ts as typeof import('typescript')
}
Expand Down

0 comments on commit 0cc220d

Please sign in to comment.