Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Nestjs: How to build nestjs app and generate dist folder?

Tags:

node.js

nestjs

I am trying to write jenkins shell script to deploy nestjs app, I try "npm run start:prod" this generate dist folder, but it serve also the app which I dont need it,

How to just build the app ?

like image 697
maroodb Avatar asked Aug 08 '19 08:08

maroodb


People also ask

Is NestJS scalable?

Nest. JS is a framework that helps build Node. JS server-side applications. The Nest framework is built using TypeScript which allows developers to build highly scalable and testable applications.

Is NestJS and Nodejs are same?

NestJS is a Node. js framework for building server-side applications. It is based on TypeScript and JavaScript. This framework is inspired by Angular, so most of what you find in Angular can also be found in Nest, including providers, middleware, components, and services.


1 Answers

You can run:

npm run build

This will just build application. This script can be found in generated Nest.js project when you generate project with Nest CLI.

The script itself could look like this:

"build": "tsc -p tsconfig.build.json"

And content of tsconfig.build.json could look like this:

{
  "extends": "./tsconfig.json",
  "exclude": ["node_modules", "test", "**/*spec.ts"]
}
like image 183
Ivan Vasiljevic Avatar answered Sep 19 '22 15:09

Ivan Vasiljevic