Thanks for the reply , I’ll take a look at the test project and see if I can adapt to it.
What I’m kinda worried about is the part “relative imports, e.g. “utils/test” are relative to /assets”, because in my actual project, that TSModule folder can be built using npm commands, and it’s hosted in a separate Git repository. I would like it not to depend on Hugo’s environment.
And I would like to import MainClass.tsx inside Component 2.2/index.tsx. Currently, it’s possible to do:
import MainClass from '../../../MainClass.tsx'
But by using tsconfig.json, defining path property, I was able to import that file using the following syntax, which I think could be more clear and easy to write:
import MainClass from '~/MainClass.tsx'
Does Hugo have currently this kind of mechanism? Like redefining paths only for specific modules. In this case, ~ is only applied for files under assets/someModule, and by writing ~, it resolves to some specific path of module, like assets/someModule/src/*
Edit: mechanism to avoid relative-path hell is what I meant to say.