@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.
|
@@ -1089,13 +1089,24 @@ const getBundleTags = (loadableExtractor, scripts, staticRoutePath = 'static') =
|
|
|
1089
1089
|
return startupTag;
|
|
1090
1090
|
};
|
|
1091
1091
|
|
|
1092
|
+
/**
|
|
1093
|
+
* Arguably deprecated functionality driven by a version.json file
|
|
1094
|
+
* injected into the container from the CI build process.
|
|
1095
|
+
* This is used to provide version information for the application
|
|
1096
|
+
* such as the commit id and the build number.
|
|
1097
|
+
* @param staticFolderPath if the app is not built into the `dist/static` folder, we can provide a different path to the static folder.
|
|
1098
|
+
* @returns version.json as a JSON object, or an empty object if the file cannot be read.
|
|
1099
|
+
*/
|
|
1092
1100
|
const getVersionInfo = staticFolderPath => {
|
|
1093
1101
|
try {
|
|
1094
1102
|
const versionData = fs.readFileSync(`dist/${staticFolderPath}/version.json`, 'utf8');
|
|
1095
1103
|
const versionInfo = JSON.parse(versionData);
|
|
1096
1104
|
return versionInfo;
|
|
1097
1105
|
} catch (ex) {
|
|
1098
|
-
|
|
1106
|
+
// We don't need to log this error as it is just noise in the logs
|
|
1107
|
+
// when the version.json file is not constructed and injected into
|
|
1108
|
+
// the build container or a development stub included in the project.
|
|
1109
|
+
// console.error(`Unable to read from "version.json"`, ex);
|
|
1099
1110
|
return {};
|
|
1100
1111
|
}
|
|
1101
1112
|
};
|