0

I am trying to pick up angularjs v2 using the official documentation provided.

I followed the instructions on this page.

https://angular.io/docs/ts/latest/guide/setup.html

After I run npm start, I see a webpage http://localhost:3000/ being launched automatically on my default browser.

I see several js files in the quickstart folder. Which are the js files that are being run and in what sequence? Is there a main file that tells npm which files to run for npm start? How does npm knows which files to run?

guagay_wk
  • 26,337
  • 54
  • 186
  • 295

3 Answers3

3

In your package.json file there will be a "script" named "start". The one you are running from is found here: https://github.com/angular/quickstart/blob/master/package.json

"start": "tsc && concurrently \"tsc -w\" \"lite-server\" ",

It is executing the command tsc && concurrently "tsc -w" "lite-server"

For usage of the tsc and concurrently node packages check out npmjs.com:

Mitch
  • 1,839
  • 16
  • 23
1

you can make a alert("file name") on every file to see which one run first or console.log("file name ") ;

Ahmed Mostafa
  • 666
  • 1
  • 4
  • 16
1

From npm help start

This runs an arbitrary command specified in the package's "start" property of its "scripts" object. If no "start" property is specified on the "scripts" object, it will run node server.js.

So open package.json

"scripts": {
  "test": "echo \"Error: no test specified\" && exit 1"
},

Just add something to it.

"scripts": {
  "test": "echo \"Error: no test specified\" && exit 1",
  "start": "arbitrary command"
},
Evan Carroll
  • 78,363
  • 46
  • 261
  • 468