This PR uses a new Karma plugin to enable vendor bundles in unit tests,
increasing rebuild performance.
On a medium size project rebuilds times were 15x smaller (16.5s to 0.9s).
Fix#5423
I tried to implement a continuous integration system on my VPS. I have a PHP script that runs ng build. However in my default PHP configuration no environment variable HOME or USERPROFILE was set. I had this error : `Path must be a string. Received undefined`.
I had to take some time to see where the problem came from so I made a pull request to clarify the error.
Now it is : `Error: Missing environment variable HOME` which does not require to look at the code. This message would have saved me some time.
Also fixes any encountered errors.
This only changes the version used for the CLI's development. The project template version of tslint cannot be updated until codelyzer supports the latest version. ([codelyzer tracking issue](https://github.com/mgechev/codelyzer/issues/281))
Blocked by #5500 (fix is included in this PR so that CI will run).
Our unit test webpack config was erroneously sending in entry points to karma-webpack, who should receive no entry points.
This in turn was hiding errors related to typeRoots lookups.
It was also causing unit tests compilation to behave weirdly: unit test errors would not stop compilation, because other entries would still compile.
This might also have contributed to the overall slowness of unit tests in #5423.
Related to TypeStrong/ts-node#283Fix#3911Fix#5332Fix#5351
A new CLI config entry under `test` allows you to list exclude globs for code coverage:
```
"test": {
"codeCoverage": {
"exclude": [
"src/polyfills.ts",
"**/test.ts"
]
},
"karma": {
"config": "./karma.conf.js"
}
},
```
This PR adds tsconfigs for each separate application:
- `src/tsconfig.app.json`: configuration for the Angular app.
- `src/tsconfig.spec.json`: configuration for the unit tests. Defaults to the Angular app config.
- `e2e/tsconfig.e2e.json`: configuration for the e2e tests.
There is an additional root-level `tsconfig.json` that is used for editor integration.
For Angular version 4 projects, these tsconfigs will use inheritance since it's available with TypeScript 2.1.
This is not a breaking change. Existing projects should not be affected.
Currently dev builds use `--output-hashing=none` by default.
This can cause image resources to be overwritten in dev if they have the same same.
This wasn't much of a problem before when only images in global CSS would be treated as resources, but now component css also does that.
Production builds are unaffected since they already use `--output-hashing=all`.
BREAKING CHANGE: dev builds will hash relative resources from CSS (images, etc).
This provides increased viability for long-term caching by limiting the
changes to the content of output files due to webpack module identifier
changes.
Close#4733
Fixing component css in #4667 uncovered errors in CSS url processing.
This PR correctly composes absolute urls when using `--base-href` and/or `--deploy-url`.
It also fixes asset output on `--aot` mode.
Fix#4778Fix#4782Fix#4806
* test: add license test
* only check prod dependencies
* remove findup dep
* also check dev deps
* add map-stream to ignore list
* remove license-checker
* add comment
* use logger
* fix lint errors
This is useful when you don't want the server to rebuild in the middle of something.
A good example is when running e2e tests. Especially on larger suites, one would prefer to continue working while the build is tested without compromising tests.
This will break tests on #4744. They should be adjusted to add the `--watch` flag since they depend on the live reload behaviour during `ng e2e`.
Heavily based on @jsanchezgarcia work in #4476.
Fix#3857
BREAKING CHANGE:
A new environmentSource entry replaces the previous source entry inside environments.
To migrate the code follow the example below:
Before:
```
"environments": {
"source": "environments/environment.ts",
"dev": "environments/environment.ts",
"prod": "environments/environment.prod.ts"
}
```
After:
```
"environmentSource": "environments/environment.ts",
"environments": {
"dev": "environments/environment.ts",
"prod": "environments/environment.prod.ts"
}
```
Adds the flag 'serviceWorker' to angular-cli.json that enables support for @angular/service-worker.
When this flag is true, production builds will be set up with a service worker. A ngsw-manifest.json file
will be generated (or augmented) in the dist/ root, and the service worker script will be copied there.
A short script will be added to index.html to register the service worker.
@angular/service-worker is a dependency of @angular/cli, but not of generated projects. It is desirable
for users to be able to update the version of @angular/service-worker used in their apps independently
of the CLI version. Thus, the CLI will error if serviceWorker=true but @angular/service-worker is not
installed in the application's node_modules, as it pulls all the service worker scripts from there.
If the flag is false the effect on the CLI is minimal - the webpack plugins associated with the SW are
not even require()'d.
Closes#4544