mirror of
https://github.com/angular/angular-cli.git
synced 2025-05-17 11:03:53 +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
|
* found in the LICENSE file at https://angular.io/license
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { colors } from './color';
|
|
||||||
|
|
||||||
function isDisabled(variable: string): boolean {
|
function isDisabled(variable: string): boolean {
|
||||||
return variable === '0' || variable.toLowerCase() === 'false';
|
return variable === '0' || variable.toLowerCase() === 'false';
|
||||||
}
|
}
|
||||||
@ -77,21 +75,3 @@ export const allowMinify = debugOptimize.minify;
|
|||||||
*/
|
*/
|
||||||
const maxWorkersVariable = process.env['NG_BUILD_MAX_WORKERS'];
|
const maxWorkersVariable = process.env['NG_BUILD_MAX_WORKERS'];
|
||||||
export const maxWorkers = isPresent(maxWorkersVariable) ? +maxWorkersVariable : 4;
|
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 { json } from '@angular-devkit/core';
|
||||||
import { join, resolve } from 'path';
|
import { join, resolve } from 'path';
|
||||||
import { cachingDisabled } from './environment-options';
|
|
||||||
import { VERSION } from './package-version';
|
import { VERSION } from './package-version';
|
||||||
|
|
||||||
export interface NormalizedCachedOptions {
|
export interface NormalizedCachedOptions {
|
||||||
@ -39,10 +38,6 @@ export function normalizeCacheOptions(
|
|||||||
const isCI = process.env['CI'] === '1' || process.env['CI']?.toLowerCase() === 'true';
|
const isCI = process.env['CI'] === '1' || process.env['CI']?.toLowerCase() === 'true';
|
||||||
|
|
||||||
let cacheEnabled = enabled;
|
let cacheEnabled = enabled;
|
||||||
if (cachingDisabled !== null) {
|
|
||||||
cacheEnabled = !cachingDisabled;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (cacheEnabled) {
|
if (cacheEnabled) {
|
||||||
switch (environment) {
|
switch (environment) {
|
||||||
case 'ci':
|
case 'ci':
|
||||||
|
Loading…
x
Reference in New Issue
Block a user