Reputation: 10760
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:
I have a tsconfig.js
file which tells the TypeScript compiler what to do.
I have a packages.json
file which tells node which packages to download.
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
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