In favor of process.cwd(). Also added a new eject e2e test that verifies
the webpack.config.js does NOT have the project path in it at any place.
Fixed#9335.
Adds sourcemap and minification to javascript added via the `scripts` array in `.angular-cli.json`.
`script-loader` is no longer used, which should help with CSP since it used `eval`.
Scripts will no longer appear in the console output for `ng build`, as they are now assets instead of webpack entry points.
It's no longer possible to have the `output` property of both a `scripts` and a `styles` entry pointing to the same file. This wasn't officially supported or listed in the docs, but used to be possible.
Fix#2796Fix#7226Fix#7290
Related to #6872
Circular dependencies, like `app.module.ts` importing `app.component.ts` which in turn imports `app.module.ts`, now display a warning during builds:
```
kamik@T460p MINGW64 /d/sandbox/master-project (master)
$ ng build
Hash: 3516b252f4e32d6c5bb8
Time: 8693ms
chunk {0} polyfills.bundle.js, polyfills.bundle.js.map (polyfills) 160 kB {4} [initial] [rendered]
chunk {1} main.bundle.js, main.bundle.js.map (main) 5.95 kB {3} [initial] [rendered]
chunk {2} styles.bundle.js, styles.bundle.js.map (styles) 10.5 kB {4} [initial] [rendered]
chunk {3} vendor.bundle.js, vendor.bundle.js.map (vendor) 1.88 MB [initial] [rendered]
chunk {4} inline.bundle.js, inline.bundle.js.map (inline) 0 bytes [entry] [rendered]
WARNING in Circular dependency detected:
src\app\app.module.ts -> src\app\app.component.ts -> src\app\app.module.ts
WARNING in Circular dependency detected:
src\app\app.component.ts -> src\app\app.module.ts -> src\app\app.component.ts
```
It is important to detect and eliminate circular dependencies because leaving them in might lead to `Maximum call stack size exceeded` errors, or imports being `undefined` at runtime.
To remove these warnings from your project you can factor out the circular dependency into a separate module.
For instance, if module A imports `foo` from module B, and module B imports `bar` from module A, it is enough to extract `foo` into module C.
You can turn off these warnings by running ng set apps.0.hideCircularDependencyWarnings=true. This will add the "hideCircularDependencyWarnings": true value to your .angular-cli.json and disable the warnings.
Fix#6309Fix#6739
`prepree2e` doesn't run because it's a lifecycle script for a lifecycle script, but even if it did it would not work because there is nothing coordinating the serve and e2e processes.
Users must manually initialize the server prior to running e2e tests after ejecting.
Related to https://github.com/angular/angular-cli/issues/6171
Currently vendor Angular libraries will have their *.ngfactory.ts in main.ts when building with `--aot`.
The easiest way to see this is with `source-map-explorer.
This PR correctly puts them in vendor.ts.