176 Commits

Author SHA1 Message Date
Alan Agius
e9897de7ae fix(@angular-devkit/build-angular): change css optimizer from clean-css with cssnano
Closes #16123 and closes #13854
2020-01-13 09:46:15 -08:00
Alan Agius
0659cf09e3 fix(@angular-devkit/build-angular): add externalDependencies to server builders
Certain node packages depend on native bindings which cannot be bundled, with this fix we add a way to exclude these from being processed by the bundler.

Closes: #16348
2019-12-05 18:53:08 -08:00
Alan Agius
0a7ace3595 fix(@angular-devkit/build-angular): allow bundleDependencies to be a boolean 2019-12-05 18:53:08 -08:00
Filipe Silva
3079b06bd0 test: re-enable ivy aot rebuild test 2019-12-02 12:50:14 -08:00
FDIM
2c0efd834b fix(@angular-devkit/build-angular): mocked context in single test transform matches webpack API 2019-11-23 10:35:45 +02:00
Charles Lyding
cfc0aa4780 fix(@angular-devkit/build-angular): properly process es2016+ targets with differential loading
A target of es2015 was previously assumed when using differential loading.  This could result in erroneously downleveling an es2016+ output file instead of generating a new es5 output file.
2019-11-20 13:21:58 -08:00
Filipe Silva
bf39e74e7f fix(@ngtools/webpack): fix rebuilds for transitive and global type deps
Fix #15856
2019-11-19 11:40:58 -08:00
Filipe Silva
8a0f92bd83 fix(@ngtools/webpack): recursive look up unused files
Fix #15626
2019-11-12 11:48:41 -08:00
Filipe Silva
9b91163c52 fix(@ngtools/webpack): don't warn on unused ngsummary
Fix https://github.com/angular/angular-cli/issues/15626#issuecomment-551632356
2019-11-12 11:48:41 -08:00
Filipe Silva
d438cf0f45 test: increase debounce time for rebuild tests 2019-11-05 16:40:37 -08:00
Alan Agius
0f3587173a test: verify that link in outputpath is not deleted at source
Closes: #15183
2019-11-05 16:39:14 -08:00
Alan Agius
588baa5737 fix(@angular-devkit/build-angular): i18n app shell with Ivy 2019-10-30 09:36:14 -07:00
Alan Agius
77a4fba45f fix(@angular-devkit/build-angular): don't emit CSS resources during a server build
The server should serve the assets emitted by the browser builder. In fact the nguniversal schematics are configured to serve the assets from the browser folder
a0cc9ab97a/modules/express-engine/schematics/install/files/__serverFileName%40stripTsExtension__.ts (L26)

Closes #12878
2019-10-29 20:21:24 -07:00
Charles Lyding
dd4bc23a48 fix(@angular-devkit/build-angular): keep licenses if extraction is disabled 2019-10-25 15:22:26 -07:00
Alan Agius
f943d3a8dc refactor(@angular-devkit/build-angular): rename ngModuleDef to ɵmod 2019-10-16 05:56:23 -07:00
Alan Agius
e847ee5c83 fix(@angular-devkit/build-angular): change the ngComponentDef to ɵcmp
Related to 64fd0d6db9
2019-10-16 05:56:23 -07:00
Alan Agius
d9bf2dbbda fix(@angular-devkit/build-angular): avoid attempting to copy directories
Avoid copying directly directories, also which this change we cache `fs.existsSync` to optimize copying when a lot of file are being copied to the same destination.

Closes: #15816
2019-10-11 13:53:48 -07:00
Filipe Silva
47490527ff feat(@angular-devkit/build-angular): add experimentalRollupPass (#15690)
In applications that make heavy use of lazy routes and ES2015 libraries, this option can improve bundle sizes. It might also break your bundles in ways we don't understand fully, so please test and report any problems you find.

NOTE: the following are known problems with experimentalRollupPass
- vendorChunk, commonChunk, namedChunks: these won't work, because by the time webpack sees the chunks, the context of where they came from is lost.
- webWorkerTsConfig: workers must be imported via a root relative path (e.g.`app/search/search.worker`) instead of a relative path (`/search.worker`) because of the same reason as above.
- loadChildren string syntax: doesn't work because rollup cannot follow the imports.
2019-10-10 12:39:38 -07:00
Alan Agius
c3169ae7d2 New i18n schema (#15760)
* feat(@angular-devkit/core): update schema to support new i18n options

"projects": {
  "my-app": {
    "projectType": "application",
    "schematics": {},
    "root": "",
    "i18n": {
      "sourceLocale": "en-US",
      "locales": {
        "fr": "src/locale/messages.fr.xlf"
      }
    },
    "sourceRoot": "src",
    ...
  }
}

* feat(@angular-devkit/build-angular): add new i18n options to browser and server builders

With this change we add `translateLocales` as new options for i18n in browser and server builders.

We also deprecate the following options;
* i18nLocale
* i18nFormat
* i18nFile

* feat(@angular-devkit/build-angular): deprecate `i18nFormat` and `i18nLocale` options of `extract-i18n` builder

Option `i18nFormat` has been deprecated in favor of `format` and `i18nLocale` option has been deprecated in favor of the `sourceLocale` sub option of the `i18n` project level option.

* feat(@angular/cli): add alias of `i18n-extract` for `x18n` command

* refactor: rename `translateLocales` to `localize`
2019-10-10 12:39:00 -07:00
Alan Agius
4d2ef2bf57 feat(@angular-devkit/build-angular): add support for i18n extraction with Ivy (#15796)
Re-enable i18n extraction in Ivy by using the legacy VE compiler.
2019-10-09 11:04:48 -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
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
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
Filipe Silva
6a29ce47a1 test: add issue for broken app-shell test 2019-08-30 22:53:46 +05:30
Filipe Silva
ecc9d0e2b5 test: update server builder specs 2019-08-30 22:53:46 +05:30
Filipe Silva
77cb0d3f41 test: add issue for disabled Ivy AOT rebuild test 2019-08-30 22:53:46 +05:30
Filipe Silva
430e75978a test: re-enable lazy route error tests for Ivy 2019-08-30 22:53:46 +05:30
Filipe Silva
45155dc489 test: fix external source map test for Ivy 2019-08-30 22:53:46 +05:30
Alan Agius
dffa70affa test: refactor karma include spec
disable index of failing test and remove timeout which is less than the default
2019-08-30 00:11:14 +05:30
Filipe Silva
60f9b19ecd test: use Ivy by default, opt-in to VE 2019-08-28 22:54:52 +05:30
Alan Agius
09d2f04d1b fix(@angular-devkit/build-angular): update worker-plugin to 3.2.0 (#15456)
includes this fix https://github.com/GoogleChromeLabs/worker-plugin/pull/35 which solves the below issues.

Fixes #15188 and fixes #14582
2019-08-28 00:10:26 -07:00
Charles Lyding
2e4cae172e test: remove additional usages of experimental workspaces 2019-08-16 09:32:04 -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
Alan Agius
0111693271 Ivy build_ng_packagr (#15262)
* test: update ng-packagr builder tests to work on Windows

* build: add ng packagr test large for ivy

* test: fix web-worker test in ivy

Previously, we were not testing web workers under Ivy as we were overriding tsconfig.app.json entirely without including enableIvy.

When enabling Ivy we are getting warning of files that are part of the compilation which causing a warning to show and break the test.

* build: update ng-packagr to `^5.4.0`

* test: display ivy mode message once
2019-08-12 10:20:02 -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 Agius
9478ee9c47 fix(@ngtools/webpack): gracefully show error when compiling broken component styles
Fixes #15240
2019-08-05 18:01:53 -07:00
Alan Agius
f4be0ba677 fix(@ngtools/webpack): display unused file warning once per file 2019-08-05 18:00:13 -07:00
Alan Agius
607e6f7cfd test: increase/add debounceTime to reduce flakiness 2019-07-29 15:06:10 -07:00
vikerman
07780b9272 style: clean up existing lint errors 2019-07-24 23:28:49 -07:00
Alan
6649483d86 fix(@ngtools/webpack): delete all virtual files for styles on change
Fixes #15143
2019-07-24 19:07:10 -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
28bd5493a7 fix(@ngtools/webpack): retain child compilation warnings and errors
At the moment child compilation warnings and errors are being lost as they are not passed to the root compilation.  This means that any errors that are being set by clean-css for component styles are being lost.
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
Alan Agius
63f0049e43 feat(@ngtools/webpack): show warning when a TS compilations contains unused files
When a tsconfig without `includes` or `files` all files under the `rootDir` will be included in the compilation. This results in redundant files to inserted as part of the ts compilation which in some cases might reduce the compilation drastically.

Related to: TOOL-949
2019-07-24 19:03:35 -07:00
Charles
6d4f8a249c test: remove material-design-icons package as a development dependency (#15096)
The package is quite large at 33MB (46MB on disk).  The package is also only used in one test that is already covered by an E2E test.  The E2E test does not require the package to be present for development as the test installs it within a generated project during execution.  This also has the benefit of testing the icons package in a more real world use case; as well as allowing the test to serve as a guide for a user to add the package to their own application.
2019-07-16 14:41:59 -07:00
Alan Agius
0551360035 fix(@schematics/angular): exclusively list the files in tsconfigs (#15030)
* test: update tests to work with new stricter tsconfig file inclusions

* fix(@schematics/angular): exclusively list the files in tsconfigs

With the omission of `includes` or `files` in tsconfig files tsc will pick up all the files under the rootDir and make them as part of the compilation. In certain cases, redundant files will be picked up which will cause a slower compilations.

Related to: TOOL-949
2019-07-16 11:04:29 -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
Alan
885005241e build: update webpack to version 4.35.3 2019-07-11 01:21:18 +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