Skip to content

Commit e308008

Browse files
clydinalan-agius4
authored andcommitted
refactor(@angular-devkit/build-angular): use build version stamping for build cache path creation
The build process will automatically perform package version placeholder replacement within source files. This allows for the package version to be injected into the build cache path creation process as a constant. As the version is now a constant, there is no need to attempt runtime loading of the package metadata to retrieve the package version.
1 parent 8442216 commit e308008

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,10 @@
66
* found in the LICENSE file at https://angular.io/license
77
*/
88

9-
import { join, resolve } from 'path';
10-
import { VERSION } from './package-version';
9+
import { join, resolve } from 'node:path';
10+
11+
/** Version placeholder is replaced during the build process with actual package version */
12+
const VERSION = '0.0.0-PLACEHOLDER';
1113

1214
export interface NormalizedCachedOptions {
1315
/** Whether disk cache is enabled. */

0 commit comments

Comments
 (0)