833 Commits

Author SHA1 Message Date
Renovate Bot
05e6e8f1e1 build: update terser-webpack-plugin to version 2.2.2 2019-12-09 17:05:07 -08:00
Renovate Bot
840ff49f13 build: update postcss to version 7.0.24 2019-12-09 17:04:52 -08:00
renovate[bot]
a5198f19c1 Merge pull request #16380 from angular/renovate/babel
build: update @babel/core to version 7.7.5
2019-12-09 17:04:11 -08:00
Renovate Bot
4b741030b0 build: update @angular/animations to version 2019-12-09 17:03:59 -08:00
Doug Parker
982df7e77a fix(@angular-devkit/build-angular): update budgets to check differential builds separately
Fixes #15792.

Previously, budgets would include content for both versions of a differential build. Thus the `initial` budget would count content from the ES5 **and** ES2015 bundles together. This is a very misleading statistic because no user would download both versions. I've updated the budget calculators to take this into account and generate size values for both builds which are then checked independently of each other.

The only calculators I changed are the `InitialCalculator` (for computing `initial` bundle sizes) and `BundleCalculator` (for computing named bundles). Since budgets are handled by Webpack for builds without differential loading, the `initial` bundle will always have those two sizes. The `BundleCalculator` might reference a bundle which does not have differential loading performed (such as a CSS file), so it emits sizes depending on whether or not multiple builds were found for that chunk.

Most of the other calculators don't really need to take differential loading into account. `AnyScriptCalculator` and `AnyCalculator` already apply on a file-by-file basis, so they generate sizes for both build versions already. `AnyComponentStyleCalculator` only applies to CSS which does not have differential builds.

The wierd ones here are `AllCalculator` and `AllScriptCalculator` which reference files with and without differential builds. Conceptually, they should be separated, as a "total" budget specified by an app developer probably wanted it to mean "the total resources a user would have to download", which would only be one differential build at a time. However, I don't see a good way of identifying which assets belong to which differential build. Even if an asset belongs to a chunk with differential builds, we don't know which build takes which assets into account. I decided to leave this for the time being, but it is probably something we should look into separately.

Since budgets take differential loading into account, users might reasonably want to set different budgets for different builds (ie. "initial-es2015 bundle should be capped at 100k, but initial-es5 bundle can go to 150k"). That's more of a feature request, so I also left that out for a future PR.
2019-12-09 15:26:50 -08:00
Doug Parker
6427922415 fix(@angular-devkit/build-angular): remove async files from initial bundle budget.
Refs #15792.

Static files listed in `angular.json` were being accounted in the `initial` bundle budget even when they were deferred asynchronously with `"lazy": true` or `"inject": false`. Webpack belives these files to be `initial`, so this commit corrects that by finding all extra entry points and excluding ones which are explicitly marked by the application developer as asynchronous.

One edge case would be that the main bundle might transitively depend on one of these static files, and thus pull it into the `initial` bundle. However, this is not possible because the files are not present until the end of the build and cannot be depended upon by a Webpack build step. Thus all files listed by the application developer can be safely assumed to truly be loaded asynchronously.
2019-12-09 15:26:50 -08:00
Doug Parker
1792ccaf57 refactor(@angular-devkit/build-angular): move budget computations to be post-build
Refs #15792.

This provides access to all the size information necessary because all build steps have already completed. This commit is roughly a no-op because it simply moves the budget checks (for different builds) to be executed post-build.

The lone exception is the AnyComponentStyle budget. Component stylesheet files are not emitted after the build is completed, so there is no size information to work with. Instead, these budgets are checked during a separate plugin (exected for different builds **and** non-differential builds).
2019-12-09 15:26:50 -08:00
Smartin
c73e28e91c refactor(@angular-devkit/build-angular): export executeExtractI18nBuilder
export executeExtractI18nBuilder for use in custom builders and to be consistent with browser- and dev-server-builder.

no breaking changes, no issue
2019-12-09 13:42:08 -08:00
Charles Lyding
f4bb020b94 fix(@angular-devkit/build-angular): ensure source locale data is injected when localizing
Fixes #16389
2019-12-09 13:40:50 -08:00
Alan Agius
f1985e1315 fix(@angular-devkit/build-angular): resolve @babel/preset-env
This is needed as otherwise under Bazel we hit `Cannot find module '@babel/preset-env` we use `require.resolve` since this is always patched under Bazel.
2019-12-09 13:39:35 -08:00
Alan Agius
41c63ea871 fix(@angular-devkit/build-angular): add symlinks option to resolveLoader
This is needed as otherwise under Bazel it will fail with `Angular Compiler was detected but it was an instance of the wrong class.` when not using the linker since node_modules will be linked to `external/npm`. Under Bazel `preserveSymlinks` is to be set to true, however with the current behaviour this doesn't effect resolveLoader.
2019-12-09 13:39:35 -08:00
Charles Lyding
713f95d678 fix(@angular-devkit/build-angular): localize service worker base href 2019-12-09 13:39:06 -08:00
Alan Agius
cae943d7e6 fix(@angular-devkit/build-angular): add notice when using bundleDependencies: none with Ivy
Related to: https://github.com/angular/universal/issues/1354
2019-12-09 13:38:34 -08:00
Renovate Bot
6fa9c2f5af build: update browserslist to version 4.8.2 2019-12-05 18:56:05 -08:00
Doug Parker
59c9802d26 fix(@angular-devkit/build-angular): suppress duplicate 3rdpartylicenses.txt warning
Refs #16193

This detects and filters out error messages about duplicate 3rdpartylicenses.txt. This is a short-term fix intended to get us to 9.0.x release while a follow up effort will work to properly fix this bug. Left a TODO to remove this filter once a fix is ready.
2019-12-05 18:55:15 -08:00
Alan Agius
302a9f325c refactor(@angular-devkit/build-angular): don't add a SourceMapDevToolPlugin when sourcemaps are disabled 2019-12-05 18:53:08 -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
Alan Agius
4f19e36dc9 refactor: deprecated unused server builder options 2019-12-05 18:52:27 -08:00
Renovate Bot
d71eea1aed build: update @angular/animations to version 9.0.0-rc.5 2019-12-05 18:51:22 -08:00
Renovate Bot
8270c8539a build: update caniuse-lite to version 1.0.30001015 2019-12-04 08:23:25 -08:00
Charles Lyding
c37eaeec43 fix(@angular-devkit/build-angular): augment base HREF when localizing
All locale i18n options now support an object form which allows a base HREF to be defined for the locale.  Each locale can now optionally define a custom base HREF that will be combined with the base HREF defined for the build configuration.  By default if the shorthand form for the locale is used or the field is not present in the longhand form, the locale code will be used as the base HREF.  To disable automatic augmentation a base HREF value of an empty string (`""`) can be used.  This will prevent anything from being added to the existing base HREF.

For common scenarios, the shorthand form will result in the preferred and recommended outcome of each built locale variant of the application containing a defined base HREF  containing the locale code.
2019-12-04 08:14:16 -08:00
Renovate Bot
3df09bcd8f build: update core-js to version 3.4.7 2019-12-03 12:35:23 -08:00
Renovate Bot
9bec2d9aee build: update autoprefixer to version 9.7.3 2019-12-02 12:51:10 -08:00
Filipe Silva
3079b06bd0 test: re-enable ivy aot rebuild test 2019-12-02 12:50:14 -08:00
Filipe Silva
8f35cdddc8 build: use material 9.0.0-rc.4 2019-12-02 12:50:14 -08:00
Charles Lyding
1d79b28c17 fix(@angular-devkit/build-angular): support differential loading for web workers
Fixes #16275
2019-12-02 10:19:38 -08:00
Charles Lyding
09a7d87f00 fix(@angular-devkit/build-angular): ensure HTML lang attribute is set when localizing 2019-12-02 10:17:57 -08:00
Alan Agius
d155c7c804 fix(@angular-devkit/build-webpack): allow runWebpackDevServer to accept a webpackDevServerFactory 2019-12-02 10:16:08 -08:00
Alan Agius
2960a71807 fix(@angular-devkit/build-angular): pass webpack factor to runWebpackDevServer 2019-12-02 10:16:08 -08:00
Renovate Bot
0ea43cc5a1 build: update @angular/animations to version 9.0.0-rc.4 2019-12-02 10:15:15 -08:00
Renovate Bot
cb8f72a934 build: update style-loader to version 1.0.1 2019-12-02 10:13:45 -08:00
Renovate Bot
de69cd4286 build: update browserslist to version 4.8.0 2019-12-02 10:13:34 -08:00
Renovate Bot
32a76982b4 build: update rollup to version 1.27.8 2019-12-02 10:13:15 -08:00
Renovate Bot
393ea955a8 build: update caniuse-lite to version 1.0.30001013 2019-12-02 10:11:13 -08:00
Renovate Bot
eb3c239659 build: update terser to version 4.4.2 2019-12-02 09:39:18 -08:00
Renovate Bot
a956cea867 build: update file-loader to version 5.0.2 2019-11-27 13:43:25 -08:00
Renovate Bot
8e6c4ac297 build: update raw-loader to version 4.0.0 2019-11-26 13:12:38 -08:00
Renovate Bot
f696c72450 build: update caniuse-lite to version 1.0.30001012 2019-11-26 13:11:41 -08:00
Renovate Bot
4f62105164 build: update @babel/core to version 7.7.4 2019-11-26 13:10:54 -08:00
Renovate Bot
37763ed4a3 build: update rollup to version 1.27.5 2019-11-26 13:09:46 -08:00
Renovate Bot
3b00104249 build: update core-js to version 3.4.3 2019-11-26 13:09:13 -08:00
Charles Lyding
ef7748524c fix(@angular-devkit/build-angular): make i18n translation files relative to workspace
All other paths within the workspace file are relative to the workspace root.
2019-11-26 13:08:29 -08:00
Alan Agius
02c50fbd6a refactor(@angular-devkit/build-angular): deprecate karma environment option
This option is unused and has no effect
2019-11-26 13:07:42 -08:00
Alan Agius
07801363a6 fix(@angular-devkit/build-angular): add pattern validations for browserTarget and serverTarget 2019-11-26 13:07:13 -08:00
Charles Lyding
3d5a5a97a4 fix(@angular-devkit/build-angular): enable dynamic import parsing with serve localization
Fixes #16248
2019-11-26 13:05:30 -08:00
Charles Lyding
adb4139b80 fix(@angular-devkit/build-angular): cache localize results with development server 2019-11-26 13:05:30 -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
Greg Magolan
a4200a0f04 refactor(@angular-devkit/build-angular): allow @angular/core version 0.0.0
Allow version "0.0.0" for integration testing in the angular/angular repository with the generated development @angular/core npm package which is versioned "0.0.0".
This is a pre-req for https://github.com/angular/angular/pull/33927 which runs integration tests against the bazel generated npm packages.
2019-11-22 22:36:31 +01:00
Renovate Bot
486b37063d build: update rollup to version 1.27.3 2019-11-21 14:06:38 -08:00