Skip to content

Commit b8564a6

Browse files
alan-agius4clydin
authored andcommitted
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.
1 parent 455c6bc commit b8564a6

File tree

2 files changed

+0
-25
lines changed

2 files changed

+0
-25
lines changed

packages/angular_devkit/build_angular/src/utils/environment-options.ts

-20
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
* found in the LICENSE file at https://angular.io/license
77
*/
88

9-
import { colors } from './color';
10-
119
function isDisabled(variable: string): boolean {
1210
return variable === '0' || variable.toLowerCase() === 'false';
1311
}
@@ -77,21 +75,3 @@ export const allowMinify = debugOptimize.minify;
7775
*/
7876
const maxWorkersVariable = process.env['NG_BUILD_MAX_WORKERS'];
7977
export const maxWorkers = isPresent(maxWorkersVariable) ? +maxWorkersVariable : 4;
80-
81-
// Build cache
82-
const cacheVariable = process.env['NG_BUILD_CACHE'];
83-
export const cachingDisabled = (() => {
84-
if (!isPresent(cacheVariable)) {
85-
return null;
86-
}
87-
88-
// eslint-disable-next-line no-console
89-
console.warn(
90-
colors.yellow(
91-
`Warning: 'NG_BUILD_CACHE' environment variable support will be removed in version 14.\n` +
92-
`Configure 'cli.cache' in the workspace configuration instead.`,
93-
),
94-
);
95-
96-
return isDisabled(cacheVariable);
97-
})();

packages/angular_devkit/build_angular/src/utils/normalize-cache.ts

-5
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99
import { json } from '@angular-devkit/core';
1010
import { join, resolve } from 'path';
11-
import { cachingDisabled } from './environment-options';
1211
import { VERSION } from './package-version';
1312

1413
export interface NormalizedCachedOptions {
@@ -39,10 +38,6 @@ export function normalizeCacheOptions(
3938
const isCI = process.env['CI'] === '1' || process.env['CI']?.toLowerCase() === 'true';
4039

4140
let cacheEnabled = enabled;
42-
if (cachingDisabled !== null) {
43-
cacheEnabled = !cachingDisabled;
44-
}
45-
4641
if (cacheEnabled) {
4742
switch (environment) {
4843
case 'ci':

0 commit comments

Comments
 (0)