Skip to content

MarArMar/TurboSvelteKitTypia

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Description of the problem

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 the sveltekit plugin in the vite.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 the rollup-plugin-typescript2 plugin config, no effect (in tsconfig.json it does suppress a warning)
  • setting allowImportingTsExtensions: true in the rollup-plugin-typescript2 plugin config & tsconfig, no effect (samchon/typia#812 (comment))
  • using tspCompiler in the rollup-plugin-typescript2 plugin config, no effect (samchon/typia#812 (comment))

Tried solutions proposed in :

Setup

pnpm add turbo --global
pnpm install

Working

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

Sveltekit with Js : working test

Dev

npx turbo run dev --filter=SvelteKitJS

Sveltekit with Ts : not working example

Dev

npx turbo run dev --filter=SvelteKitTS

Build

npx turbo run build --filter=SvelteKitTS

Other Not working

sveltekit in workspace with typia lib that imports TS files :

npx ts-node packages/typia-imported/run-import

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published