chore: pin pnpm isolated node-linker to fix svelte ts parsing
A global `node-linker=hoisted` flattens node_modules and gives svelte, @sveltejs/kit and @sveltejs/acorn-typescript separate `acorn` copies. Since svelte parses TypeScript via `Parser.extend(tsPlugin())`, the mismatched Parser class hierarchy makes every `<script lang="ts">` block fail with "Unexpected token" during `vite build`. Pinning pnpm's default isolated linker in the repo `.npmrc` overrides any global setting so all three packages resolve a single `acorn` instance.
This commit is contained in:
@@ -1 +1,7 @@
|
|||||||
reporter=append-only
|
reporter=append-only
|
||||||
|
|
||||||
|
# Pin pnpm's default isolated linker. A global `node-linker=hoisted` flattens the
|
||||||
|
# tree and gives svelte, @sveltejs/kit and @sveltejs/acorn-typescript separate
|
||||||
|
# `acorn` copies, which breaks `Parser.extend(tsPlugin())` — every `<script lang="ts">`
|
||||||
|
# then fails to parse with "Unexpected token" during `vite build`.
|
||||||
|
node-linker=isolated
|
||||||
|
|||||||
Reference in New Issue
Block a user