502 Commits

Author SHA1 Message Date
Alan Agius
1ea4a5ffa5 feat(@angular-devkit/build-angular): ignore express and hapi depedency expresstion (#15586)
In version 9 universal express and hapi `server.ts` will be bundled using the CLI server builder.

We need to add this to avoid `the request of a dependency is an expression` warnings

See: https://github.com/angular/universal/pull/1237
2019-09-12 11:44:32 -07:00
Charles Lyding
b9f69d6796 fix(@angular-devkit/build-angular): fully optimize script bundles with bundle downleveling
This also allows terser to perform ECMA 6 level compress optimizations on the actual application bundles (non-script bundles) which can provide for further size improvements.

Fixes #15507
2019-09-10 11:07:36 -07:00
Alan Agius
3fc86b7ff5 Merge pull request #15530 from alan-agius4/protractor_base_url
fix(@angular-devkit/build-angular): add trailing back slash to protr…
2019-09-10 10:07:44 -07:00
Alan
fb0a6af9f0 fix(@angular-devkit/build-angular): make app-shell work with Ivy
Fixes #15383
2019-09-10 10:01:50 -07:00
Alan
fb24f30202 feat(@angular-devkit/build-angular): enable bundleDependencies by default for server builder
BREAKING CHANGE: bundleDependencies default value has been changed from none to all. This will result in all of node_modules to be bundled in the final server bundle.

Under Ivy, if users choose to opt-out from bundling dependencies they will need to run NGCC binary manually to make non-bundled node_modules compatible with Ivy.
2019-09-10 10:01:50 -07:00
Charles Lyding
9300627e22 fix(@angular-devkit/build-angular): disable extract comments for webpack terser plugin
terser-webpack-plugin 2.0.0+ enables the extract comments option by default which is not used by the CLI.
2019-09-10 10:01:25 -07:00
noeri
366e51be04 feat(@angular-devkit/build-angular): expose webpack-dev-server's allowedHosts option
Closes #13656
2019-09-09 14:09:58 -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
Alan Agius
2c8b12f45c feat(@angular-devkit/build-angular): update sass-loader to 8.0.0
Full list of changes https://github.com/webpack-contrib/sass-loader/blob/master/CHANGELOG.md#800-2019-08-29
2019-09-05 00:24:32 +05:30
Alan Agius
c935211aef fix(@angular-devkit/build-angular): several issues with optimization and bundleDependencies in universal
Fixes #15498
2019-09-04 02:31:20 +05:30
Filipe Silva
6a29ce47a1 test: add issue for broken app-shell test 2019-08-30 22:53:46 +05:30
Alan Agius
058299c531 fix(@angular-devkit/build-angular): remove deprecation of baseUrl in protractor builder
Closes #13952
2019-08-30 00:15:10 +05:30
Alan Agius
77c4d4aa7b fix(@angular-devkit/build-angular): disable top level variable and function name mangling
Disables toplevel mangling and enables compression for es5 bundles. With compress enabled we reduce a further ~7Kb

Closes: #15436
2019-08-30 00:14:32 +05:30
Charles Lyding
fc53087bd2 refactor(@angular-devkit/build-angular): add debug no mangle environment variable 2019-08-30 00:10:48 +05:30
Charles Lyding
c867f2a4dd fix(@angular-devkit/build-angular): ensure generator polyfills are present for ES5 2019-08-30 00:10:29 +05:30
Adam Vigneaux
e76ea36989 feat(@angular-devkit/build-angular): exclude TSX test files from test coverage 2019-08-30 00:09:39 +05:30
Charles
0f18e35373 fix(@angular-devkit/build-angular): add sourcemap comment for ES2015 differential loading (#15461)
Fixes #15460
2019-08-28 00:11:55 -07:00
Alan Agius
26dd51221a style: collapse if statements (#15449) 2019-08-27 10:25:14 -07:00
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
af9a8b75ee fix(@angular-devkit/build-angular): default poll value when not present (#15417)
`--poll` is a valid command line option (vs. `--poll 1000`).  This however will result in a value of 0 which causes polling to be disabled rather than enabled.  This change sets a default value of 500 when the commandline flag is used.
2019-08-23 11:37:48 -07:00
Adam Vigneaux
e7d99bc727 feat(@angular-devkit/build-angular): collect test coverage from JSX/TSX files 2019-08-21 10:31:45 -07:00
Charles Lyding
d1488e66a4 refactor(@angular-devkit/build-angular): cache downlevel bundles 2019-08-20 11:07:55 -07:00
Alan Agius
f2ecb904a9 fix(@angular-devkit/build-angular): serve option merging is being overridden by defaults in schema (#15328)
We have a number of browser options that we allow the dev-server to merge. However, this only happens when such as options are undefined from the dev-server builder. At the moment these option have defaults inside their schema which results in them never being `undefined`, and hence the overridden logic is bypassed.

See: 6dd5b186d4/packages/angular_devkit/build_angular/src/dev-server/index.ts (L49-L63) and 6dd5b186d4/packages/angular_devkit/build_angular/src/dev-server/index.ts (L107-L115)

Fixes #15273 and fixes #15064
2019-08-14 17:55:04 -07:00
Charles
3db2787cea refactor(@angular-devkit/build-angular): update webpack typings (#15334) 2019-08-14 10:22:32 -07:00
Filipe Silva
b3b45469f5 fix(@angular-devkit/build-angular): never use component css sourcemap when optimizations are on. (#15238)
It will just increase bundle size without offering good debug experience.
2019-08-12 10:32:03 -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
Charles Lyding
4183d16e81 fix(@angular-devkit/build-angular): additional ES5 browser polyfills based on babel usage analysis 2019-08-08 08:26:15 -07:00
Filipe Silva
fbea65b371 fix(@angular-devkit/build-angular): use GLOBAL_DEFS_FOR_TERSER_WITH_AOT if present
Fix #15206
2019-08-05 17:59:42 -07:00
Alan Agius
195e493a66 fix(@angular-devkit/build-angular): various breakpoints issues
With this change we address 2 main issues related to unbound breakpoints:
1) in VS code when having a `baseHref` set.
2) Visual Studio when using an SPA inside a ASP.NET project

For the latter, it seems that there is no way to set a `webRoot`. However, `webpack:///` seems to be handled internally and will be mapped to the `SpaRoot` ie `ClientApp` folder.

Fixes: #15211
2019-08-02 13:41:16 -07:00
Alan Agius
0fd7abb818 refactor: cleancss-webpack-plugin to use async/await 2019-08-02 13:35:22 -07:00
Alan Agius
f7c7619556 fix(@angular-devkit/build-angular): escape dot in js extensions to match literally
Closes #15195
2019-07-30 14:25:21 -07:00
Alan Agius
15ef15e94a style: remove redundant max-line-length disables and fix other lint issues 2019-07-24 19:06:21 -07:00
Alan
0224d2b92e fix(@angular-devkit/build-angular): fix sourcemaps for vscode breakpoints
`namespace` is always empty which is breaking sourcemaps since when sources start with `/` vscode will not be able to resolve them unless users configure `sourceMapPathOverrides`.

Fixes #15116
2019-07-24 19:05:43 -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
069a18200e fix(@angular-devkit/build-angular): support pnpm with ng serve
Webpack and its development server assume the presence of two node builtins (`events` & `querystring`).  Do to package hoisting npm/yarn will usually place the shims for those two builtins at locations that webpack find them.  This is however not guaranteed nor will it work with pnpm which strictly follows the prescribed dependency tree.
To remedy this, the specific node shims are enabled only for the specific internal webpack files that are used within the development server.  This ensures that the requirements of these files does not pollute the entire application.

Fixes #13680
2019-07-24 19:03:15 -07:00
Charles
f8a58213eb feat(@angular-devkit/build-angular): add defer attributes to classic scripts (#15087)
This change synchronizes the behavior of classic scripts and module scripts (`type="module"`).  Module scripts are deferred by default.  Also, certain injected scripts are not considered module scripts even in a ES2015+ build due to the strict mode behavior of module scripts.  Deferring such scripts also ensures consistent execution in those scenarios.
2019-07-16 09:58:19 -07:00
Filipe Silva
9d9d46bab3 refactor: use buildOptimizerLoaderPath 2019-07-11 01:18:26 +08:00
Filipe Silva
9b7f196a80 feat(@angular-devkit/build-angular): run Build Optimizer only on TS-generated files 2019-07-11 01:18:26 +08:00
Alan
b48dede4e0 fix(@angular-devkit/build-angular): fix sourcemaps paths
`output.devtoolModuleFilenameTemplate` is not used when `SourceMapDevToolPlugin`

671cb184e3/lib/SourceMapDevToolPlugin.js (L77)

Current stacktraces are not properly formatted
```
http://localhost:9876/_karma_webpack_/webpack:/src/app/dummy.component.spec.ts:36:76
```

With this change we wil change this to
```
http://localhost:9876/src/app/validation-directive.ts:13:23
```

This also allows users to click on the stacktrace in the browser and go to source.
2019-07-11 01:17:57 +08: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
Charles Lyding
445f3873b9 fix(@angular-devkit/build-angular): use query option to set sockJS path in dev-server
Fixes #15002
2019-07-10 04:15:30 +08:00
Charles Lyding
f6953f0123 fix(@angular-devkit/build-angular): only add module script types to actual module scripts
`ng serve` was errantly adding a module type to custom script bundles.  These scripts may contain ES5 and non-strict compatible code and can therefore not be marked as module scripts.  `ng build` already correctly operates in this fashion.

Fixes #14952
2019-07-10 04:13:43 +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
Suguru Inatomi
4bfa4e0c06 fix(@angular-devkit/build-angular): add Symbol.iterator polyfill for legacy browsers 2019-06-27 09:26:31 -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
FDIM
af2b1b55dc feat(@angular-devkit/build-angular): option to build and test only specified spec files 2019-06-24 17:27:25 -07:00