The "dev" script had a problem: it only worked if the "build" script had been run first. This problem occurred because of the import alias. Sucrase, which we used to run the code, was unable to resolve imports using the import alias.
To solve the problem, I found the tsconfig-paths package, which solves this import alias problem in typescript.
src/main/server.ts
import './config/module-alias'
import `tsconfig-paths/register` // adding the package
import app from '@/main/config/app'
import env from '@/main/config/env'
app.listen(env.port, () => { console.log(`Server running at http://localhost:${env.port}`) })
The "dev" script had a problem: it only worked if the "build" script had been run first. This problem occurred because of the import alias. Sucrase, which we used to run the code, was unable to resolve imports using the import alias.
To solve the problem, I found the
tsconfig-paths
package, which solves this import alias problem in typescript.src/main/server.ts