Updates : now works, see config, had to add " include: ["../../**/*.ts+(|x)"],"
In this monorepo (Turborepo), within Vite-Sveltekit projects that do not use EsBuild in the vite config :
- ✅ TS files from the same project work
- ✅ JS file from the PNPM workspace work
- ✅ On a regular Sveltekit install, TS files on the PNPM workspace work
- BUT When I import a TS file on the PNPM workspace work I get this :
Parse failure: Unexpected token (3:26)
At file: /@fs/TurboSvelteKitTypia/packages/common/log.ts
Contents of line 3: export const messageLoaded: string =
If I remove TS syntax from the TS file it works again. It seems the file is imported as JS
The file that loads the other files is TurboSvelteKitTypia\apps\SvelteKitTS\src\routes+page.svelte
Tried :
- putting the
rollup-plugin-typescript2
plugin before thesveltekit
plugin in thevite.config.ts
, it didn't work - importing the file with
.ts
at the end of the import, no effect - importing the file from a relative path
.ts
at the end of the import, no effect (vitejs/vite#5370 (comment)) - setting
sourceMap: false,
in therollup-plugin-typescript2
plugin config, no effect (intsconfig.json
it does suppress a warning) - setting
allowImportingTsExtensions: true
in therollup-plugin-typescript2
plugin config & tsconfig, no effect (samchon/typia#812 (comment)) - using
tspCompiler
in therollup-plugin-typescript2
plugin config, no effect (samchon/typia#812 (comment))
Tried solutions proposed in :
pnpm add turbo --global
pnpm install
pnpm workspace with typia & TS imports :
npx ts-node packages/typiaLib/run.ts
pnpm workspace lib that imports typia :
npx ts-node packages/typia-imported/run-import
sveltekit in workspace with typia lib that imports only JS files :
npx ts-node packages/typia-imported/run-import
Dev
npx turbo run dev --filter=SvelteKitJS
Dev
npx turbo run dev --filter=SvelteKitTS
Build
npx turbo run build --filter=SvelteKitTS
sveltekit in workspace with typia lib that imports TS files :
npx ts-node packages/typia-imported/run-import