Skip to content

Commit 0ebd9b0

Browse files
committed
fix: don't bundle typescript compiler
1 parent b3446c8 commit 0ebd9b0

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

composables/parser/javascript/TypescriptGui.vue

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,22 @@
11
<script lang="ts">
2-
import Typescript from 'typescript'
2+
import { parserModulePromise } from '~/state/parser/module'
3+
import type Typescript from 'typescript'
4+
35
const useOption = makeUseOption<
46
Typescript.CreateSourceFileOptions & { scriptKind: Typescript.ScriptKind }
57
>()
68
</script>
79

810
<script setup lang="ts">
9-
const scriptKind = useOption('scriptKind', Typescript.ScriptKind.TS, true)
11+
const ts = await parserModulePromise.value
12+
const scriptKind = useOption('scriptKind', ts.ScriptKind.TS, true)
1013
const languageVersion = useOption(
1114
'languageVersion',
12-
Typescript.ScriptTarget.Latest,
15+
ts.ScriptTarget.Latest,
1316
true,
1417
)
1518
16-
const versions = Object.entries(Typescript.ScriptTarget).filter(
19+
const versions = Object.entries(ts.ScriptTarget).filter(
1720
([_, value]) => typeof value === 'number',
1821
)
1922
</script>
@@ -24,7 +27,7 @@ const versions = Object.entries(Typescript.ScriptTarget).filter(
2427
<span>sourceType</span>
2528
<select v-model="scriptKind">
2629
<option
27-
v-for="kind in Object.entries(Typescript.ScriptKind).filter(
30+
v-for="kind in Object.entries(ts.ScriptKind).filter(
2831
([_, value]) => typeof value === 'number',
2932
)"
3033
:key="kind[0]"

0 commit comments

Comments
 (0)