Open dcsan opened 4 years ago
Hello, I am not sure what your essential question point is. Unfortunately, I have never used ts-node
here is my currently solution:
// project/index.js
module.exports = require('./dist/node/index.js').default
and
// project/src/server.ts
...
server.use(express.static('dist')) // to serve frontend
...
// project/src/...others.ts // and so on
currently, I use webpack { target: 'node' } and npm:webpack-node-externals
to build out dist codes.
maybe, soon, https://deno.land/ could be better
The point is to not hardcode file names and let users provide routing programmatically. It has little to do with ts-node
.
Describe the bug It seems bottender has a hardwired path expecting an
index.js
in the same directory as you run the server. I'm moving a project to typescript so the raw source is undersrc
and I usually run in dev withts-node
I'm wondering if there's a way to pass the routes file to botTender explicitly when starting up?
I'm not quite sure how to wire those things together, there seems to be some lazy loading going on with the routing currently.
Expected behavior A more explicit way to startup a project, less magic requires happening behind the scenes...
This is mainly to support a project in typescript