feat: expose build info via new versions plugin (#9820)
This commit is contained in:
19
src/core/plugins/versions/after-load.js
Normal file
19
src/core/plugins/versions/after-load.js
Normal file
@@ -0,0 +1,19 @@
|
||||
/**
|
||||
* @prettier
|
||||
*/
|
||||
import win from "core/window"
|
||||
|
||||
const afterLoad = () => {
|
||||
// eslint-disable-next-line no-undef
|
||||
const { GIT_DIRTY, GIT_COMMIT, PACKAGE_VERSION, BUILD_TIME } = buildInfo
|
||||
|
||||
win.versions = win.versions || {}
|
||||
win.versions.swaggerUI = {
|
||||
version: PACKAGE_VERSION,
|
||||
gitRevision: GIT_COMMIT,
|
||||
gitDirty: GIT_DIRTY,
|
||||
buildTimestamp: BUILD_TIME,
|
||||
}
|
||||
}
|
||||
|
||||
export default afterLoad
|
||||
10
src/core/plugins/versions/index.js
Normal file
10
src/core/plugins/versions/index.js
Normal file
@@ -0,0 +1,10 @@
|
||||
/**
|
||||
* @prettier
|
||||
*/
|
||||
import afterLoad from "./after-load.js"
|
||||
|
||||
const VersionsPlugin = () => ({
|
||||
afterLoad,
|
||||
})
|
||||
|
||||
export default VersionsPlugin
|
||||
Reference in New Issue
Block a user