Remotec
Remotec

Reputation: 10760

How does NPM start an Angular and Typescript application?

Would it be possible to get an explanation of how npm start works?

I have an Angular 2 application written in Typescript. I enter npm start in the console and this both compiles and launches the application using Node's built in web server.

However what is the starting point for this? Which files does the npm start command read in order to compile and start the application? Also why do I use npm start and not e.g. node start? I understood that NPM was just the package manager for node itself.

What I understand so far:

Where do the following files fit into this:

main.ts

app/app.module.ts - which I understand is the starting point for my application.

How do all of these components fit together to form the application?

Upvotes: 1

Views: 360

Answers (1)

Joe Clay
Joe Clay

Reputation: 35797

npm start is just an alias for npm run start, which runs whatever command is in scripts.start in your package.json.

It neither knows nor cares about TypeScript, or Angular, or anything like that - it just executes whatever script it's given on the command line.

Upvotes: 3

Related Questions