mirror of
https://github.com/zhigang1992/create-react-app.git
synced 2026-04-24 05:05:53 +08:00
Ensure files get purged when they should (#5054)
This commit is contained in:
21
packages/react-dev-utils/getCacheIdentifier.js
vendored
Normal file
21
packages/react-dev-utils/getCacheIdentifier.js
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
/**
|
||||
* Copyright (c) 2015-present, Facebook, Inc.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
module.exports = function getCacheIdentifier(environment, packages) {
|
||||
let cacheIdentifier = `${environment}`;
|
||||
for (const packageName of packages) {
|
||||
cacheIdentifier += `:${packageName}@`;
|
||||
try {
|
||||
cacheIdentifier += require(`${packageName}/package.json`).version;
|
||||
} catch (_) {
|
||||
// ignored
|
||||
}
|
||||
}
|
||||
return cacheIdentifier;
|
||||
};
|
||||
Reference in New Issue
Block a user