hiroppy/ssr-sample

Stop using ts-node in production

xkguq007 opened this issue · 3 comments

First of all, Sorry for bad English.

This repository is very helpful for react ssr with styled component, typescript, NodeJS express framework. My company use this stack (including NextJS).
We are looking for boilerplate implementation without NextJS.
This repository can be used part of boilerplate properly.

Here is the thing.
ts-node contributor said, ts-node must not be used in production.
However, your package.json, when npm run start:prod -> server runs using ts-node.
How can I changed it properly?

Here is what I did
change start:prod,
"cross-env NODE_ENV=production npm run start" TO
"cross-env NODE_ENV=production node ./dist/server/index.js"
and "npm run build" -> "npm run build:server" -> "npm run start:prod"

am I right? or something elegance one?

ts-node contributor said ts-node must not be used in production.

Yes, don't use ts-node at production.

However, sorry but I create this for just a server side rendering sample.
If you want to know how to run in production without using ts-node, I can write a production webpack config.

@xkguq007 I fixed this issue. #102

Thanks for answering