RoadmapShopEvents
Skip to main content

Home > @microsoft/rush-lib > BuildCacheConfiguration

BuildCacheConfiguration class

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

Use this class to load and save the "common/config/rush/build-cache.json" config file. This file provides configuration options for cached project build output.

Signature:
export declare class BuildCacheConfiguration

Properties

PropertyModifiersTypeDescription
buildCacheEnabledboolean(BETA) Indicates whether the build cache feature is enabled. Typically it is enabled in the build-cache.json config file.
cacheWriteEnabledboolean(BETA) Indicates whether or not writing to the cache is enabled.
cloudCacheProviderICloudBuildCacheProvider | undefined(BETA) The provider for interacting with the cloud build cache, if configured.
getCacheEntryIdGetCacheEntryIdFunction(BETA) Method to calculate the cache entry id for a project, phase, and project state.
localCacheProviderFileSystemBuildCacheProvider(BETA) The provider for interacting with the local build cache.

Methods

MethodModifiersDescription
getBuildCacheConfigFilePath(rushConfiguration)static(BETA) Gets the absolute path to the build-cache.json file in the specified rush workspace.
loadAndRequireEnabledAsync(terminal, rushConfiguration, rushSession)static(BETA) Loads the build-cache.json data from the standard file path common/config/rush/build-cache.json. If the file has not been created yet, or if the feature is not enabled, then an error is reported.
tryLoadAsync(terminal, rushConfiguration, rushSession)static(BETA) Attempts to load the build-cache.json data from the standard file path common/config/rush/build-cache.json. If the file has not been created yet, then undefined is returned.