hiroppy / ssr-sample

A minimum sample of Server-Side-Rendering, Single-Page-Application and Progressive Web App
288 stars 38 forks source link

Stop using ts-node in production #100

Closed xkguq007 closed 5 years ago

xkguq007 commented 5 years ago

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?

hiroppy commented 5 years ago

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.

hiroppy commented 5 years ago

@xkguq007 I fixed this issue. #102

xkguq007 commented 5 years ago

Thanks for answering