183 Commits

Author SHA1 Message Date
Charles Lyding
dd2a6947ff refactor(@angular-devkit/build-angular): improve performance of parallel bundle processing 2019-09-27 14:41:08 -07:00
Charles Lyding
d3e4dfa0c0 fix(@angular-devkit/build-angular): display accurate sizes for downlevelled files
Fixes #15425
2019-09-26 10:00:35 -07:00
Charles Lyding
8dd67cd3cb fix(@angular-devkit/build-angular): inject correct SRI values in downlevel bundles
Fixes #15468
2019-09-26 10:00:35 -07:00
Charles Lyding
d73a098900 refactor(@angular-devkit/build-angular): account for disabled mangling in downlevel cache 2019-09-26 10:00:35 -07:00
Alan
18fb7faf10 feat(@angular-devkit/build-angular): deprecate lazyModules option
String form of lazy loading and SystemJsNgModuleLoader are deprecated, and this is part of its usage.

See: https://angular.io/api/core/SystemJsNgModuleLoader#systemjsngmoduleloader
2019-09-25 09:47:14 -07:00
Charles Lyding
ffd153a6a2 refactor(@angular-devkit/build-angular): use project metadata in builders
This eliminates the need to manually read a workspace file and removes the use of the experimental workspace API from the package.
2019-09-24 13:18:33 -07:00
Alan Agius
ab5b1909d6 build: update rxjs to 6.5.3 2019-09-24 13:18:09 -07:00
Charles Lyding
8a4bc54ef3 fix(@angular-devkit/build-angular): workaround Node.js copyFile defect on macOS
Fixes #15544
2019-09-19 14:42:04 -07:00
Alan Agius
5e1b3785f6 fix(@angular-devkit/build-angular): fix permission errors for ES5 bundles
copyFilesSync will also copy permissions which may result in permissions errors.

Closes #15490
2019-09-05 00:27:39 +05:30
Charles
4986577f8a fix(@angular-devkit/build-angular): skip downlevel processing of assets (#15433)
* fix(@angular-devkit/build-angular): identify asset emitted files

* fix(@angular-devkit/build-angular): skip downlevel processing of assets

Fixes #15423
2019-08-26 11:50:20 -07:00
Charles Lyding
d1488e66a4 refactor(@angular-devkit/build-angular): cache downlevel bundles 2019-08-20 11:07:55 -07:00
Charles Lyding
1c6f665c4f feat(@angular-devkit/build-angular): implement bundle level downleveling to support differential loading 2019-08-08 08:26:15 -07:00
Alan
bcf250c94d feat(@angular-devkit/build-angular): add bundle budget for component styles
It’s very easy to inadvertently import toplevel css in component styles. Since component css is standalone and self-contained, it will never be shared between components and remains as a single large bundle for each component. This in turn adds a large amount of code that must be processed and increases bundle size.

Related to: TOOL-949
2019-07-24 19:05:00 -07:00
Alan Agius
4f8e349033 fix(@angular-devkit/build-angular): only add module script types to actual module scripts
Fixes #15102
2019-07-24 19:04:31 -07:00
Charles Lyding
8e97df3888 feat(@angular-devkit/build-angular): allow control of index output path
This allows the output path of an application's index HTML file to be controlled independently of the input file.  The output path for the file will be considered relative to the application's configured output path.  This allows an application to contain multiple input index files for different configurations and allow the output file to remain constant.  This also enables the placement of the index file in a subdirectory within the output path or change the name of the output index file neither of which was previously possible.
2019-07-10 04:34:20 +08:00
Alan
2b367be1c3 feat(@angular-devkit/build-angular): deprecate scripts and styles lazy option in favor ofinject
The lazy option inside the script and style option is confusing as this option doesn't lazy load a bundle but rather it doesn't inject/reference the script in the HTML. While this option is an enabler for lazy loading, the users will still need to handle on how how this bundle will be lazy loaded. There are also potential use cases beyond lazy loading for the option.

Closes #14814
2019-07-02 11:05:51 -07:00
Alan Agius
8754ecbf99 fix(@angular-devkit/build-angular): IE11 errors when using scripts and differential loading
Invert the builds so that es2015 scripts output don't override the es5 version.

Fixes #14777
2019-07-02 10:58:36 -07:00
Alan Agius
68227565ce feat(@angular-devkit/build-angular): add crossorigin options
This options allows to define the crossorigin attribute setting of elements that provide CORS support

Closes #14743
2019-06-27 15:12:43 -07:00
Alan
44a0d0fb4e fix(@angular-devkit/build-angular): add type="module" on script tags when differential loading will be enabled
Fixes #14747
2019-06-26 11:17:21 -07:00
Hans Larsen
a5afd7b2b6 fix(@angular-devkit/build-angular): force event category to be something
If it is empty (or undefined), the Universal Analytics package will not send events.
2019-06-25 13:25:23 -07:00
Alan
c7135fae35 fix(@angular-devkit/build-angular): browser builder should not swollow error messages
Closes #14813
2019-06-19 17:07:27 -07:00
Charles Lyding
0ed8de1e8a refactor(@angular-devkit/build-angular): cleanup compatible Angular version check 2019-06-19 17:06:28 -07:00
Alan
be210778f4 fix(@angular-devkit/build-angular): emit warning when using extract-i18n in Ivy
i18n is not yet implemented in Ivy, we should emit a warning stating this and exit gracefully.

This also swaps the readTsConfig logic to use `@angular/compiler-cli` instead of `typescript`. This is needed because when parsing the tsconfig, typescript is not aware of `angularCompilerOptions` and will not merged them if they are at un upper level tsconfig file when using `extends`.

Closes #14225
2019-06-14 12:56:33 -07:00
Alan Agius
1dd399c4d2 fix(@angular-devkit/build-angular): nomodule polyfill for Safari
10.1 and iOS Safari 10.3

The nomodule polyfill needs to be loaded prior to any script and be
outside of webpack compilation because otherwise webpack will cause the
script to be wrapped in `window["webpackJsonp"]` which causes it to
fail.

This polyfill will only be injected when the either Safari 10.1 or iOS
Safari 10.3 support is required, which is based on the browsers  defined in browserslist file.

Fixes #14680
2019-06-11 09:55:03 -07:00
Alan
b361a97abe fix(@angular-devkit/build-angular): absolute outputPath outputs index.html in wrong location
Fixes #14474
2019-05-21 09:07:58 -04:00
Alan
e333450dc0 feat(@angular-devkit/build-angular): add a post transformation hook to index generation
Fixes #14392
2019-05-14 10:51:56 -07:00
Filipe Silva
a41c185713 fix(@angular-devkit/build-angular): relax typescript peerDep
We only use it for a few things but have a strict peerdep.

This strictness causes errors when updating the CLI from 7.x to 8.x projects:
```
Package "@angular/compiler-cli" has an incompatible peer dependency to "typescript" (requires ">=3.1.1 <3.2", would install "3.4.5").
```
`build-angular` did not have a peerdep in 7.x so this never was a problem.

This PR relaxes the peerdep to `">=3.1 < 3.5"`, which covers the 3.1 used in initial CLI 7.0 projects.
2019-05-07 16:16:46 -06:00
Charles Lyding
b7a26fa08b fix(@angular-devkit/build-angular): add Angular version check into required builders 2019-04-25 10:23:25 -07:00
Filipe Silva
adf46c2bd5 fix(@angular-devkit/build-angular): pass system path to readTsconfig 2019-04-24 06:32:01 -10:00
Filipe Silva
0f9de92dcb feat(@angular-devkit/build-angular): remove experimentalImportFactories option
It will just be always be used when applicable.

Fix #14218
2019-04-22 16:16:58 -07:00
Minko Gechev
36be8cd42e feat(@angular-devkit/build-angular): warn when target greater es2015
When using differential loading with targets ES5 and ES2016+, the
browser with ESM support will pick `script[type="module"]` scripts even
without supporting ES2016+ syntax.

We want to warn users in this case.
2019-04-22 11:32:48 -07:00
ManfredSteyer
201856a5ec fix(@angular-devkit/build-angular): run build steps for differential loading in sequence to avoid confusing progress information
Before, the build tasks ran in parallel and so the different webpack
instances competed over the same lines on the console.

To fail fast and to prevent to show the same errors twice, the second
build step is not executed if the first one fails.

As running these tasks in sequence causes issues with watch mode, this
PR also disables differential loading when watch mode is requested.
2019-04-19 10:54:51 -07:00
Alan Agius
5fc1f2499c feat(@angular-devkit/build-angular): deprecate es5BrowserSupport option in browser builder
In future, this will be determined from the list of supported browsers specified in the 'browserslist' file.
2019-04-16 08:44:19 -07:00
Charles Lyding
f1f49325f7 refactor(@angular-devkit/build-angular): standardize builder transforms 2019-04-15 11:32:02 -07:00
Alan Agius
a29bf4ec36 feat(@angular-devkit/build-angular): enable differential loading for es2015 builds
With this change we turn on differential loading for projects that has es2015 as script target and still want to support browsers which that don't support ES2015.

Supported browsers are defined in the browserlist file.
2019-04-15 11:03:09 -07:00
Alan Agius
efccea6e1a feat(@angular-devkit/build-angular): wire up index generation for differential loading
This change wires up the index generation for multiple bundles, we however don't  enable differential loading for users just yet. As this will be done in a separate PR to change over specs to conform with the new files
2019-04-13 10:52:45 -07:00
Charles Lyding
bd16cbc98d refactor(@angular-devkit/build-angular): use webpack config utilities in browser builder 2019-04-12 12:17:21 -07:00
Filipe Silva
323c8838ff feat(@angular-devkit/build-angular): support web workers in karma builder
Followup to https://github.com/angular/angular-cli/pull/13700, the karma builder did not get the same support but it should.
2019-04-10 08:43:14 -07:00
ManfredSteyer
32a096f3f0 feat(@angular-devkit/build-angular): differential loading
This PR adds differential loading to the browser builder. First, it checks if differential loading is needed. This is the case if the compilation target is ES2015 while the browserslist points to ES5 browsers.

For providing differential loading, it calls the methods for creating the webpack config for each compilation target (e. g. ES5 and ES2015). The needed differences between those configurations are defined using parameters also added by this PR. Then it calls webpack for each of them and merges the results

This feature is currently hidden behind a flag. To activate it, set the differentialLoading flag in browser/index.ts.
2019-04-09 09:25:37 -07:00
Charles Lyding
76492141d2 refactor(@angular-devkit/build-angular): cleanup architect imports 2019-04-03 16:28:16 +02:00
Charles Lyding
3d9200a3c8 refactor(@angular-devkit/build-angular): use build-webpack stable API module imports 2019-04-02 04:50:08 -07:00
Filipe Silva
ed0e6aab57 feat(@angular-devkit/build-angular): support TS web workers 2019-04-02 04:49:34 -07:00
Filipe Silva
1810394c3a test(@angular-devkit/build-angular): test worker bundling 2019-04-02 04:49:34 -07:00
Filipe Silva
8e3e755995 feat(@angular-devkit/build-angular): add experimentalImportFactories option 2019-03-29 14:39:48 -07:00
Charles Lyding
ba21c855c0 refactor(@angular-devkit/build-angular): cleanup stable architect API builder file names 2019-03-29 14:37:35 -07:00
Charles Lyding
dd058a2cc3 refactor(@angular-devkit/build-angular): remove experimental architect builders 2019-03-29 14:37:35 -07:00
Hans Larsen
00fb4cea4f feat(@angular-devkit/build-angular): use builder name for category
So we can differentiate between dev-server, browser, karma, etc.
2019-03-28 13:28:41 -07:00
Hans Larsen
a2ff62e2b0 feat(@angular-devkit/build-angular): add analytics for build
Add a few metrics that we want to capture in the build.
2019-03-28 13:28:41 -07:00
Hans Larsen
2e9dc3d252 docs: add analytics dimensions for schematics flags and internal doc
The analytics.md should be kept up to date with the flags.
2019-03-20 15:08:07 -07:00
Hans Larsen
53f6b5ccfe refactor: extract the deleteOutputPath logic from the builder 2019-03-19 10:07:46 -07:00