nestjs / javascript-starter

Nest framework JavaScript (ES6, ES7, ES8) + Babel starter 🍰
https://nestjs.com/
117 stars 26 forks source link

build / transpilation process #20

Closed YOO629 closed 4 years ago

YOO629 commented 4 years ago

Hi there,

I cloned this repo and it looks like when I try to use nest-cli commands such as nest build or nest start I get this error

 Error  Could not find TypeScript configuration file "tsconfig.build.json". Please, ensure that you are running this command in the appropriate directory (inside Nest workspace).

This, I assume is because the default language when you nest start is TypeScript. Using npm start is fine, but I'm not too sure about using babel-node in a production environment since the babel-node docs explicitly say it's not meant for production.

Right now my work around is to transpile manually using babel-cli using something that looks like this npx babel src/ --out-dir dist/ and then I just node dist/main.js on the prod server.

My question is, am I missing something entirely about nest-cli usage? Or am I going about this in an acceptable way since the build should just be a transpilation anyways?

Thanks in advance

kamilmysliwiec commented 4 years ago

nest start and nest build is for TSC projects.

For the javascript-starter, simply use the npm run start + npm run build

sebmodus commented 2 years ago

There is no build script in package.json