Compilation issues when using different root directory
See original GitHub issueDescription
When using typescript and specifying a different root directory via vite.config.js , compilation issues arise .
Reproduction
1 - In the provided zip, start the server, which behaves as expected. I’m running the command yarn run dev
2 - Move the index.html inside another directory, changing the root directory inside vite.config.js accordingly -> At this point, the server starts up and displays only plain html, which is to be expected, since it couldn’t find the script.
3 - Update the ‘src’ property inside the index to correctly point to the main.ts module. At this point, i’m getting a unexpected token exception. Its interesting to note that the server does starts, and the error occurs only when accessing the url.
Additional Information
Initially, i thought it had something to do with the tsconfig.json properties or path, but after changing compilerOptions, and moving the file around ( specifying its path with the tsconfigFile property inside svelte.config.js , i could not reproduce the issue.
The vite-plugin ( not included in the zip ) was installed following the directives in this repo readme.md.
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (4 by maintainers)
closing here as the original issue can be solved with relative configFile option added in 1.0.0-next.8:
svelte({configFile:"../svelte.config.js"})
no, svelte.config.ts is not supported right now. It could be added but that would have to be a concerted effort as there are other tools also reading svelte config. You could setup your own transpile step to use it without framework support