1986 Commits

Author SHA1 Message Date
Alan Agius
023d0937c4 perf(@angular-devkit/build-webpack): include only required stats in webpackStats
Until we depend on `webpackStats` in the browser builder we should only included the required stats.

The below are the needed stats;
```
    all: false,
    colors: true,
    hash: true,
    timings: true,
    chunks: true,
    builtAt: true,
    warnings: true,
    errors: true,
    assets: true,
    ids: true,
    entrypoints: true,
```
2021-06-02 18:25:58 +02:00
Alan Agius
2e007b7fe0 refactor(@angular-devkit/build-angular): update SASS worker to provide fromImport.
Since sass 1.33.0, an importer can determine whether it’s being called from an `@import` rule by checking `this.fromImport`. This API, is now being used by `sass-loader` version 12.
2021-06-02 17:17:43 +02:00
Renovate Bot
85e8b59d74 build: update dependency sass-loader to v12 2021-06-02 17:17:43 +02:00
Alan Agius
a41f2ed85c docs(@angular-devkit/build-angular): update includePaths description 2021-06-02 09:17:19 +02:00
Renovate Bot
0553de187c build: update all non-major dependencies 2021-06-02 09:16:03 +02:00
Alan Agius
494cca6426 build: update Webpack to version 5.38.1
With this change we update to `webpack` to `5.38.1`, this also updates `webpack-sources` to `2.3.0`, The latter is causing OOM errors on our CI, but it in real projects the memory usage only increased by a small fraction. Also, the OOM errors don't manifest themselves when the entire test suit is run locally.

Therefore with this change we also disable sourcemap genertation for most of the browser builds to speed up the tests and reduce memery usage.
2021-05-31 12:49:55 +01:00
Charles Lyding
92c9be44fa fix(@angular-devkit/build-angular): correctly ignore inline styles during i18n extraction
Stylesheets are not processed during i18n extraction to improve performance and the rules to support them are intentionally not present.
2021-05-31 12:48:55 +01:00
Alan Agius
f9acdc75ca fix(@angular-devkit/build-angular): provided earlier build feedback in console
With this change we provide earlier feedback in the console during a build. The setup phase can take some times if the project has a large set of dependencies.

We also move several warnings in the dev-server to an earlier phase so that we don't clutter the progress indicator.

Closes #20957
2021-05-31 12:48:00 +01:00
Alan Agius
77f81dc7f7 fix(@angular-devkit/build-angular): do not resolve web-workers in server builds
Web-workers are not supported on the server and therefore we should not try include them in server builds.

Closes #20877
2021-05-31 12:46:50 +01:00
Alan Agius
fb21c4a968 feat(@angular-devkit/build-angular): deprecate protractor builder 2021-05-26 13:27:10 -04:00
Alan Agius
7ff41e4e5a fix(@angular-devkit/build-angular): show --disable-host-check warning only when not using disableHostCheck
Closes #20951
2021-05-26 13:26:46 -04:00
Renovate Bot
6e2c292365 build: update dependency jest-worker to v27 2021-05-26 11:26:07 -04:00
Charles Lyding
459aa2bc6a refactor(@angular-devkit/build-angular): use new inlineStyleFileExtension option for inline component styles
The new `ngtools/webpack` option leverages the inline resource matching syntax combined with a custom loader instead of data URIs. This provides better resource path in loaders that do not yet fully support scheme-based resource requests.
2021-05-26 10:51:33 -04:00
Alan Agius
861a69567c fix(@angular-devkit/build-angular): resolve absolute outputPath properly
Closes #20935
2021-05-26 10:19:16 -04:00
Alan Agius
02bea8cc18 fix(@angular-devkit/build-angular): hide stacktraces from dart-sass errors 2021-05-26 10:17:26 -04:00
Alan Agius
6e07cb19c0 fix(@angular-devkit/build-angular): allow i18n extraction on application that uses web-workers
Closes #20930
2021-05-25 10:54:31 -04:00
Charles Lyding
9433bb6179 fix(@angular-devkit/build-angular): ensure latest inline stylesheet data is used during rebuilds
Fixes: #20904
2021-05-25 09:54:38 -04:00
JoostK
640a749515 perf(@angular-devkit/build-angular): load postcss-preset-env configuration once
Loading the postcss-preset-env plugin includes building a mapping of unsupported
browsers by feature, which is somewhat expensive. In large compilations, this mapping
would be recomputed for each postcss-loader instance, as the plugin was recreated
for each loader invocation. By extracting the plugin instance outside of the dynamic
plugin computation, this overhead is avoided.
2021-05-24 16:26:13 -04:00
George Kalpakas
d1953bf1aa fix(@angular-devkit/build-angular): correctly generate ServiceWorker config on Windows
Since #20518, the generation of the ServiceWorker configuration has been
broken on Windows. The reason is the use of `path.posix.*` methods on
non-POSIX paths, resulting in broken paths. I.e. we ended up with
something like the following:

```js
path.posix.relative('C:\\foo', 'C:\\foo\\bar/baz');
// Expected result: `bar/baz`
// Actual result:   `../C:\\foo\\bar/baz`
```

This caused the config generator to fail to find any files and thus fail
to populate the config with cacheable assets.

This commit fixes this by using platform-specific `path.*` methods for
path manipulation and manually normalizing the path separators before
returning the results.

Fixes #20894
2021-05-24 09:28:55 -04:00
Renovate Bot
92a7d2fe38 build: update dependency copy-webpack-plugin to v9 2021-05-22 08:36:20 -04:00
Renovate Bot
a888138437 build: update dependency source-map-loader to v3 2021-05-22 08:35:56 -04:00
Alan Agius
5855374eb5 fix(@ngtools/webpack): re-emit component stylesheet assets
With this change we re-emit assets referenced in component stylesheets which where uneffected by the change that re-triggered a re-compilation.

Since we cache the the result of processed component CSS, during a re-compilation `postcss-cli-resources` plugin will not run which causes assets to be to emit. With this change we now cache the asset and re-emit them on every change.

Closes #20882
2021-05-21 20:04:32 -04:00
Alan Agius
1ab2ef9a3f perf(@angular-devkit/build-angular): disable CSS optimization parallelism for components styles
Since we rely on child compilations to compile components CSS, using the `parallel` option will cause a significant overhead because each compilation will need to spawn a worker, in this mode the worker limit is not be honored because `css-minimizer-webpack-plugin` spawn and calulators workers during the optimization phase of a compilation and not globally per instance hence causes OOM because a large number of workers to be spawned simultaneously.

Closes #20883
2021-05-21 13:13:05 -04:00
Bjarki
c146e9c086 feat(@angular-devkit/build-angular): enable webpack Trusted Types support
As reported in #20113, webpack triggers a Trusted Types violation when
lazy-loading is used. To mitigate that, enable webpack's Trusted Types
module (introduced in webpack/webpack#9856) using 'angular#bundler' as
the policy name.
2021-05-21 13:10:52 -04:00
Alan Agius
bea90a6130 fix(@angular-devkit/build-angular): don't add .hot-update.js script tags
Closes #20855
2021-05-21 13:07:42 -04:00
Charles Lyding
4dc7cf9529 fix(@angular-devkit/build-angular): ensure Sass worker implementation supports Node.js 12.14
The Worker constructor option for a transfer list is unfortunately not supported until Node.js 12.17. For Node.js versions prior to 12.17, a manual message post is now used to transfer the necessary initialization data to the Sass workers.
2021-05-21 13:07:12 -04:00
Alan Agius
f5f41ea929 perf(@angular-devkit/build-angular): clean no-longer used assets during builds
This reduce memory consumption during re-builds.

```
runtime.ba93f81591909b93394f.hot-update.js.map will be removed
styles.ba93f81591909b93394f.hot-update.js.map will be removed
runtime.ba93f81591909b93394f.hot-update.json will be removed
runtime.ba93f81591909b93394f.hot-update.js will be removed
styles.ba93f81591909b93394f.hot-update.js will be removed
```

See https://github.com/webpack/webpack/issues/12947#issuecomment-812108140 and https://github.com/webpack/webpack/issues/13127
2021-05-18 18:55:18 +02:00
Renovate Bot
2c7e5d9fc9 build: update all non-major dependencies 2021-05-18 13:15:00 +02:00
Alan Agius
7587807857 docs(@angular-devkit/build-angular): add more info link to proxyConfig
Closes #20827
2021-05-18 12:30:57 +02:00
Ryan Lester
d34dc8853d fix(@angular-devkit/build-angular): correctly resolve babel runtime helpers
Closes #20800
2021-05-18 07:08:36 +02:00
Alan Agius
ae07d36024 build: update terser-webpack-plugin to version 5 2021-05-17 19:28:51 +02:00
Alan Agius
79c5284892 fix(@angular-devkit/build-angular): revert open to 8.0.2
Closes #20807
2021-05-17 18:05:20 +02:00
Charles Lyding
438c6d932e perf(@angular-devkit/build-angular): render Sass using a pool of workers
A pool of Workers is now used to process Sass render requests. This change allows multiple synchronous render operations to occur at the same time. Sass synchronous render operations can be up to two times faster than the asynchronous variant. The benefit will be most pronounced in applications with large amounts of Sass stylesheets.
2021-05-17 10:26:47 +02:00
Alan Agius
2643fb11a9 fix(@angular-devkit/build-angular): non injected styles should not count as initial
Closes #20781
2021-05-14 13:11:11 +02:00
Renovate Bot
f048db84de build: update dependency less-loader to v9 2021-05-14 09:45:38 +02:00
Alan Agius
4367c3a562 fix(@angular-devkit/build-angular): add NG_BUILD_MAX_WORKERS settimgs to control maximum number of workers 2021-05-14 08:29:35 +02:00
Alan Agius
0ebf7569f6 perf(@angular-devkit/build-angular): use CSS optimization plugin that leverages workers
With this change we use `css-minimizer-webpack-plugin` which leverages workers and also webpack cache.
2021-05-14 08:29:35 +02:00
Renovate Bot
1fdd0bdd92 build: update all non-major dependencies 2021-05-14 07:37:50 +02:00
Alan Agius
7df9d19297 fix(@angular-devkit/build-angular): add experimental web-assembly
Closes #20762
2021-05-13 19:36:41 +02:00
Alan Agius
d9566bfac8 perf(@angular-devkit/build-angular): reduce JSON stats
With this change we reduce the size of the JSON stats object, the main benefit that this change brings is that unspecified stats now default to `false`, due to the `all: false` configuration in e992c9a70b/packages/angular_devkit/build_angular/src/webpack/configs/stats.ts (L12)
2021-05-13 19:36:26 +02:00
Alan Agius
80a08b5e53 test: fix formatting in src/webpack/configs/styles.ts 2021-05-13 17:10:28 +02:00
Charles Lyding
cc7f75f25b perf(@angular-devkit/build-angular): execute dart-sass in a worker
The dart-sass Sass implementation will now be executed in a separate worker thread. The wrapper worker implementation provides an interface that can be directly used by Webpack's `sass-loader`.
The worker implementation allows dart-sass to be executed in its synchronous mode which can be up to two times faster than its asynchronous mode. The worker thread also allows Webpack to continue other bundling tasks while the Sass stylesheets are being processed.
2021-05-13 12:30:42 +02:00
Renovate Bot
e37a96ad8a build: update all non-major dependencies 2021-05-13 11:05:04 +02:00
Renovate Bot
ade54006f6 build: update dependency stylus-loader to v6 2021-05-13 11:04:48 +02:00
Renovate Bot
458723cdbb build: update angular 2021-05-13 06:53:01 +02:00
Alan Agius
5315791c95 build: fix typings to works with webpack 5.37.0 2021-05-13 06:52:37 +02:00
Renovate Bot
17fa3c1c2e build: update all non-major dependencies 2021-05-13 06:52:37 +02:00
Renovate Bot
9d6eecd0de build: update dependency resolve-url-loader to v4 2021-05-10 16:22:41 +01:00
Renovate Bot
d279b12e61 build: update all non-major dependencies 2021-05-10 16:22:25 +01:00
Renovate Bot
b34ed5c400 build: update all non-major dependencies 2021-05-07 14:33:04 +01:00