mirror of
https://github.com/angular/angular-cli.git
synced 2025-05-17 02:54:21 +08:00
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:
parent
455c6bc679
commit
b8564a638d
@ -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);
|
||||
})();
|
||||
|
@ -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':
|
||||
|
Loading…
x
Reference in New Issue
Block a user