refactor(@angular-devkit/build-angular): remove deprecated NG_BUILD_CACHE environment variable

BREAKING CHANGE:

`NG_BUILD_CACHE` environment variable has been removed. `cli.cache` in the workspace configuration should be used instead.
This commit is contained in:
Alan Agius 2022-03-15 11:42:18 +01:00 committed by Charles
parent 455c6bc679
commit b8564a638d
2 changed files with 0 additions and 25 deletions

View File

@ -6,8 +6,6 @@
* found in the LICENSE file at https://angular.io/license
*/
import { colors } from './color';
function isDisabled(variable: string): boolean {
return variable === '0' || variable.toLowerCase() === 'false';
}
@ -77,21 +75,3 @@ export const allowMinify = debugOptimize.minify;
*/
const maxWorkersVariable = process.env['NG_BUILD_MAX_WORKERS'];
export const maxWorkers = isPresent(maxWorkersVariable) ? +maxWorkersVariable : 4;
// Build cache
const cacheVariable = process.env['NG_BUILD_CACHE'];
export const cachingDisabled = (() => {
if (!isPresent(cacheVariable)) {
return null;
}
// eslint-disable-next-line no-console
console.warn(
colors.yellow(
`Warning: 'NG_BUILD_CACHE' environment variable support will be removed in version 14.\n` +
`Configure 'cli.cache' in the workspace configuration instead.`,
),
);
return isDisabled(cacheVariable);
})();

View File

@ -8,7 +8,6 @@
import { json } from '@angular-devkit/core';
import { join, resolve } from 'path';
import { cachingDisabled } from './environment-options';
import { VERSION } from './package-version';
export interface NormalizedCachedOptions {
@ -39,10 +38,6 @@ export function normalizeCacheOptions(
const isCI = process.env['CI'] === '1' || process.env['CI']?.toLowerCase() === 'true';
let cacheEnabled = enabled;
if (cachingDisabled !== null) {
cacheEnabled = !cachingDisabled;
}
if (cacheEnabled) {
switch (environment) {
case 'ci':