Deta micros template with typescript + tsx + express + tsup template
- 🔥 Path alias
- 🔥 Watch mode (like nodemon)
- 🔥 Simple config
- 🔥 ESNext syntax
- 🔥 Fast and minify!
- minify build (default)
- treeshake (default)
Deta currently does not have that many starter template options to choose from. In past, I always used BetaHuhn/deta-express-starter, this starter template is very good, but some coding style and config do not suit me.
As a vue developer, I'm very used to using path alias. But implementing typescript path alias always has problems after complie.
Finally, after tried vite-node / tsx
and tsup / esbuild
can resolves all the problems.
But vite-node
hmr(watch-mode)
has some problem that can't be used, so I'm choosing to use tsx
notice: rename .env.example to .env
- install the deps
$ yarn
- development start
$ yarn dev
- build for prod
$ yarn build
- preview prod
$ yarn preview
Default path alias is @
target to the src
folder.
If you wanna change it or add new alias, just modify tsconfig
paths:
tsconfig.ts
"compilerOptions": {
"baseUrl": ".",
"paths": {
"@/*":["./src/*"]
},
}
-
If you want output to keep origin structure, just go
tsup.config.ts
and change theentry
property to:
entry: ['src/**/*.ts']