@zengenti/contensis-react-base 4.0.1-beta.10 → 4.0.1-beta.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1107,13 +1107,24 @@ const getBundleTags = (loadableExtractor, scripts, staticRoutePath = 'static') =
|
|
|
1107
1107
|
return startupTag;
|
|
1108
1108
|
};
|
|
1109
1109
|
|
|
1110
|
+
/**
|
|
1111
|
+
* Arguably deprecated functionality driven by a version.json file
|
|
1112
|
+
* injected into the container from the CI build process.
|
|
1113
|
+
* This is used to provide version information for the application
|
|
1114
|
+
* such as the commit id and the build number.
|
|
1115
|
+
* @param staticFolderPath if the app is not built into the `dist/static` folder, we can provide a different path to the static folder.
|
|
1116
|
+
* @returns version.json as a JSON object, or an empty object if the file cannot be read.
|
|
1117
|
+
*/
|
|
1110
1118
|
const getVersionInfo = staticFolderPath => {
|
|
1111
1119
|
try {
|
|
1112
1120
|
const versionData = fs__default.default.readFileSync(`dist/${staticFolderPath}/version.json`, 'utf8');
|
|
1113
1121
|
const versionInfo = JSON.parse(versionData);
|
|
1114
1122
|
return versionInfo;
|
|
1115
1123
|
} catch (ex) {
|
|
1116
|
-
|
|
1124
|
+
// We don't need to log this error as it is just noise in the logs
|
|
1125
|
+
// when the version.json file is not constructed and injected into
|
|
1126
|
+
// the build container or a development stub included in the project.
|
|
1127
|
+
// console.error(`Unable to read from "version.json"`, ex);
|
|
1117
1128
|
return {};
|
|
1118
1129
|
}
|
|
1119
1130
|
};
|