UNPKG

@zohodesk/client_build_tool

Version:

A CLI tool to build web applications and client libraries

31 lines (24 loc) 868 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.configRuntimeResourceCleanup = configRuntimeResourceCleanup; var _modeUtils = require("../common/modeUtils"); var _RuntimeResourceCleanup = _interopRequireDefault(require("../custom_plugins/RuntimeResourceCleanup")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function configRuntimeResourceCleanup(options) { const chunkLoadingGlobal = (0, _modeUtils.getGlobalCacheStorageName)(options); const { resourceCleanup: runtimeResourceCleanupEnabled, hasEFC: efcEnabled } = options.efc; const { customAttributes = {} } = options; if (efcEnabled && runtimeResourceCleanupEnabled) { return new _RuntimeResourceCleanup.default({ ...customAttributes, chunkLoadingGlobal }); } return null; }