I was exploring how I could place files inside my vite project to better separate the typescript side from the gleam side and I wanted to do a structure where typescript is in /resources and gleam in /src.
Having relative imports is something I don't really appreciate since this mean if I move this file somewhere else the import would break
import { main } from "../src/client.gleam";
main();
So I decided to declare an alias # that point to the src directory instead
import { main } from "#/client.gleam";
main();
This work for vite build with for the typescript LSP plugin, it can't resolve the alias and do the type definition linking.
For now I will keep my ugly relative import but I think it would be great to proper support aliases in ts-gleam ^^
I was exploring how I could place files inside my vite project to better separate the typescript side from the gleam side and I wanted to do a structure where typescript is in
/resourcesand gleam in/src.Having relative imports is something I don't really appreciate since this mean if I move this file somewhere else the import would break
So I decided to declare an alias
#that point to thesrcdirectory insteadThis work for
vite buildwith for the typescript LSP plugin, it can't resolve the alias and do the type definition linking.For now I will keep my ugly relative import but I think it would be great to proper support aliases in
ts-gleam^^