From the course: TypeScript for Node.js Developers

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Compiling and automation, part 2

Compiling and automation, part 2

From the course: TypeScript for Node.js Developers

Start my 1-month free trial

Compiling and automation, part 2

- [Presenter] So, let's continue working on our code to automate and compile our code once we do an npm start. So, the next thing we need to is write the script for the npm start. So, let's go into their package.json file and we'll change the scripts. So, once we do the npm start, it should do the compilation first and then run our application. So, what I want to do as well is have an option of building if I simply want to build. So, in this one, we'll do a tsc and --w which, basically, watches for code changes. So, if we have any changes in our code, it's still going to watch and compile our code. So, if we simply want to build and, basically, compile our code, we'll use npm run build. For npm start, this script is no longer valid. So, let's erase that one and then do tsc and then do double ampersand, which, basically, allows us to do this command and then do this other command once this one has run successfully. So, if there's any errors in our code before it runs this, it's going…

Contents