1909 Commits

Author SHA1 Message Date
Renovate Bot
f28412c3e0 build: update babel packages 2021-04-22 09:49:19 +02:00
Renovate Bot
f96914f0d3 build: update webpack to version 5.35.0 2021-04-21 12:44:50 -07:00
Renovate Bot
4c9cbecc8d build: update sass to version 1.32.11 2021-04-21 12:44:33 -07:00
Alan Agius
eed56ab839 fix(@angular-devkit/build-angular): avoid triggering file change after file build
When using the `ContextReplacementPlugin` https://github.com/angular/angular-cli/blob/master/packages/angular_devkit/build_angular/src/webpack/configs/common.ts#L496 the new resource path will be watched by Webpack file watcher. This causes a redundant file remove event after the first build, which causes another partial rebuild right way.

Note: changing the call to ` new ContextReplacementPlugin(/\@angular(\\|\/)core(\\|\/)/);` doesn't address the problem.
2021-04-21 12:41:56 -07:00
Charles Lyding
2ac73c75e7 fix(@angular-devkit/build-angular): set Tailwind CSS mode when using Tailwind
Tailwind now suppports an environment variable named `TAILWIND_MODE` with possible values of `build` and `watch`. If the variable has not been set, the tooling will now set the variable based on the builder's `watch` option.
2021-04-21 12:39:39 -07:00
Alan Agius
82ca7d0852 fix(@angular-devkit/build-angular): show warning when using stylus
Stylus is not actively maintained and only 0.3% of the Angular CLI users use it.
2021-04-21 12:39:18 -07:00
Alan Agius
0a74d0d28d fix(@angular-devkit/build-angular): change several builder options defaults
BREAKING CHANGE:

A number of browser and server builder options have had their default values changed. The aim of these changes is to reduce the configuration complexity and support the new "production builds by default" initiative.

**Browser builder**
| Option                                 | Previous default value    | New default value |
|----------------------------------------|---------------------------|-------------------|
| optimization                           | false                     | true              |
| aot                                    | false                     | true              |
| buildOptimizer                         | false                     | true              |
| sourceMap                              | true                      | false             |
| extractLicenses                        | false                     | true              |
| namedChunks                            | true                      | false             |
| vendorChunk                            | true                      | false             |

**Server builder**
| Option        | Previous default value | New default value |
|---------------|------------------------|-------------------|
| optimization  | false                  | true              |
| sourceMap     | true                   | false             |
2021-04-21 12:39:01 -07:00
Alan Agius
a8ff9d408b test(@angular-devkit/build-angular): add debounceTime to stabilize FS 2021-04-21 12:38:17 -07:00
Charles Lyding
85ce5ec3b0 fix(@angular-devkit/build-angular): always inject live reload client when using live reload
The current stable version of `webpack-dev-server` does not fully handle Webpack 5's configuration options. In this case, the `target` option can now be an array. However, the array form is ignored by the dev server which can cause the live reload client code to not be included in the output bundles. To remedy this, the `injectClient` option is used when live reload is enabled which forces the client code to be included regardless of the `target` option.
2021-04-21 12:34:56 -07:00
Charles Lyding
ef6996aeff perf(@angular-devkit/build-angular): use Webpack's GC memory caching in watch mode
The GC caching mode will remove any unused cache entries after each rebuild. This prevents old modules from being retained indefinitely during long-lived development sessions.
2021-04-21 12:34:10 -07:00
Renovate Bot
a6cc86786b build: update core-js to version 3.10.2 2021-04-20 09:31:37 -05:00
Renovate Bot
4eb9151510 build: update css-loader to version 5.2.4 2021-04-20 09:31:12 -05:00
Charles Lyding
e107055b6f fix(@angular-devkit/build-angular): disable Webpack 5 automatic public path support
The Webpack 5 automatic public path support can cause an incorrect public path to be used to load assets and lazy loaded routes. The current logic relies on the last script element found at runtime in the application's index HTML which may not be related to the application scripts. Now if a `deployUrl` is not specified, the Webpack `publicPath` option is defaulted to an empty string which provides equivalent behavior to Webpack 4.
2021-04-20 09:29:49 -05:00
Alan Agius
7d56d480c1 fix(@angular-devkit/build-angular): recover from CSS optimization errors 2021-04-20 09:29:12 -05:00
Alan Agius
04f5dfe5e2 fix(@angular-devkit/build-angular): use new Webpack watch API in karma webpack plugin
In Webpack 5, the Webpack callback must be used when Webpack is running in watch mode.

Related warning
```
.(node:6565) [DEP_WEBPACK_WATCH_WITHOUT_CALLBACK] DeprecationWarning: A 'callback' argument need to be provided to the 'webpack(options, callback)' function when the 'watch' option is set. There is no way to handle the 'watch' option without a callback.
```
2021-04-20 09:27:05 -05:00
Alan Agius
cb9e51f687 refactor(@angular-devkit/build-angular): remove custom Webpack Stats types
Webpack 5 contains improved types that we can leverage.
2021-04-20 09:27:05 -05:00
Renovate Bot
1c6ba1f9f6 build: update open to version 8.0.6 2021-04-19 20:33:19 +02:00
Renovate Bot
072f3a7009 build: update webpack to version 5.34.0 2021-04-19 20:33:01 +02:00
Renovate Bot
6d0207d4a2 build: update less-loader to version 8.1.1 2021-04-19 20:32:40 +02:00
Renovate Bot
fd655d463f build: update sass to version 1.32.10 2021-04-19 20:32:27 +02:00
Charles Lyding
5804fec902 refactor(@angular-devkit/build-angular): remove Webpack 4 specific type casting
Webpack 5 contains improved types and exports that reduce the need to perform additional type casting throughout the internal Webpack plugins.
2021-04-19 20:32:13 +02:00
Charles Lyding
e0cb8222ea fix(@angular-devkit/build-angular): replace Webpack 4 hashForChunk hook usage
Webpack 5 now uses a `chunkHash` hook that is accessible from `JavascriptModulesPlugin.getCompilationHooks()`. The `hashForChunk` hooks have been deprecated in Webpack 5.
2021-04-19 20:31:59 +02:00
Charles Lyding
e55923656c fix(@angular-devkit/build-angular): avoid double build optimizer processing
TypeScript files had the potential to be processed twice by the build optimizer. This did not affect the output code but could lead to longer production build times. The build optimizer is now configured in one centralized location for both TypeScript and JavaScript files. The Webpack configuration partial for TypeScript support is also reduced to one common function for both AOT and JIT as a result.
2021-04-19 20:30:21 +02:00
Renovate Bot
71717cf406 build: update mini-css-extract-plugin to version 1.5.0 2021-04-19 20:30:05 +02:00
Alan Agius
b8875397ce docs(@angular-devkit/build-angular): add readme file 2021-04-19 09:39:59 -05:00
Alan Agius
d7bedb7293 build: promote @angular-devkit/build-angular to stable 2021-04-14 15:50:27 -04:00
Charles Lyding
27e63e2b33 fix(@angular-devkit/build-angular): mark programmatic builder execution functions as experimental
While the builders when executed via the Angular CLI and their associated options are considered stable, the programmatic APIs are not considered officially supported and are not subject to the breaking change guarantees of SemVer.
The programmatic APIs for the builders are now explicitly marked as experimental. This allows the package to use a stable versioning scheme while also continuing to provide access to the experimental programmatic API elements of the package.
2021-04-14 14:32:37 -04:00
Charles Lyding
d3bc530c10 refactor(@angular-devkit/build-angular): use Node.js promise fs API in service-worker augmentation
With the minimum version of Node.js now set to v12, the promise fs API can now be leveraged within the tooling.
This change also uses `copyFile` (with copy-on-write where available) to setup the the service worker files as well a streaming APIs to generate service worker hashes. Both of which improves performance and reduces memory usage.
2021-04-14 10:17:21 -04:00
Renovate Bot
8dbc5e7ee0 build: update cssnano to version 5.0.1 2021-04-14 07:22:20 -04:00
Charles Lyding
bac563e5ee feat(@angular-devkit/build-angular): support specifying stylesheet language for inline component styles
A new build option named `inlineStyleLanguage` has been introduced that will allow a project to define the stylesheet language used in an application's inline component styles. Inline component styles are styles defined via the `styles` property within the Angular `Component` decorator. Both JIT and AOT mode are supported. However, JIT mode requires that inline styles only be string literals (compile-time partial evaluation is not supported in JIT mode). Currently supported language options are: `CSS` (default), `Sass`, `SCSS`, and `Less`. If the option is not specified, `CSS` will be used and enables existing projects to continue to function as expected.
2021-04-14 07:21:11 -04:00
Charles Lyding
330235230c refactor(@angular-devkit/build-angular): remove redundant webpack-sources dependency
The `webpack` package now exports the `Source` based classes directly.
2021-04-13 15:34:54 -04:00
Alan Agius
076ab0f11f refactor: add correct schema keys
With this change
- We replace `id` with `$id`,  this no longer valid in draft-07.
- Replace all `$schemas` to `http://json-schema.org/draft-07/schema`, this is needed to "pin" the schema to `draft-07`.

More information about `draft-07` can be found https://json-schema.org/draft-07/json-schema-release-notes.html
2021-04-13 10:51:12 -04:00
Alan Agius
c609e7104c build: update to cssnano to version 5.0.0
Closes #19106
2021-04-13 10:50:02 -04:00
Alan Agius
cc52e5453c fix(@angular-devkit/build-angular): remove duplicate application bundle generation complete message
In some scenarios in Webpack 5 percentage goes from 1 back to 0.99, ex: 0.99 -> 1 -> 0.99 -> 1. This causes the "complete" message to be displayed multiple times.
2021-04-13 10:49:40 -04:00
Alan Agius
1532e32cc2 refactor: clean up webpack 4 code 2021-04-13 10:49:17 -04:00
Renovate Bot
871f9eee77 build: update webpack to version 5.32.0 2021-04-13 10:43:33 -04:00
Charles Lyding
440f57943d build: update webpack to version 5.31.2 2021-04-12 14:08:43 -04:00
Charles Lyding
d47b4417d4 feat(@angular-devkit/build-angular): support processing component inline CSS styles
The internal Webpack configuration now includes support for style rules with MIME type conditions. This allows the data URIs generated for inline component CSS styles by the Angular Webpack plugin to be processed with the same loaders as file based styles.
2021-04-12 14:08:43 -04:00
Alan Agius
dee6b79489 refactor: remove @types/webpack 2021-04-12 10:02:07 -04:00
Alan Agius
0f4bbb58d4 refactor(@angular-devkit/build-angular): remove webpack 4 checks
These are no longer needed as we don't support Webpack 4 any longer
2021-04-12 10:02:07 -04:00
Alan Agius
bd0aba7c80 fix(@angular-devkit/build-angular): disable webpack cache when using NG_BUILD_CACHE 2021-04-12 10:02:07 -04:00
Alan Agius
ab9e5dd138 build: update @types/karma to ^6.3.0 2021-04-12 06:24:54 -04:00
Renovate Bot
23d6ba07fb build: update postcss to version 8.2.10 2021-04-11 17:23:09 -04:00
Renovate Bot
c47da9ad47 build: update license-webpack-plugin to version 2.3.17 2021-04-11 08:35:14 -04:00
Renovate Bot
92a93280f8 build: update less-loader to version 8.1.0 2021-04-10 12:09:28 -04:00
Renovate Bot
47f09fab79 build: update css-loader to version 5.2.1 2021-04-10 12:09:19 -04:00
Alan Agius
695a01ba02 feat(@schematics/angular): configure new libraries to be published in Ivy partial mode
With this change we configure new libraries to be published using Ivy partial compilation instead of the deprecated View Engine rendering engine, we also remove several view engine specific `angularCompilerOptions`.

New libraries can be published using this format, as they are not depend upon by View Engine libraries or application.
2021-04-09 18:40:39 -04:00
Alan Agius
f145312666 fix(@angular-devkit/build-angular): update karma builder to use non-deprecated API
With this change we update the Karma builder to use the new Server API.

Closes: #20479
2021-04-09 13:36:07 -04:00
Renovate Bot
934753c330 build: update postcss-loader to version 5.2.0 2021-04-09 07:14:20 -04:00
Renovate Bot
6953391afb build: update css-loader to version 5.2.0 2021-04-09 07:13:36 -04:00