diff --git a/src/main.ts b/src/main.ts index 4948e9e..931aadb 100644 --- a/src/main.ts +++ b/src/main.ts @@ -52,6 +52,8 @@ if(splash) { }); } +console.info(`LiveAtlas version ${store.state.version}`); + const app = createApp(App).use(store); // app.config.performance = true; diff --git a/src/store/state.ts b/src/store/state.ts index 75dc6c0..7edd7ed 100644 --- a/src/store/state.ts +++ b/src/store/state.ts @@ -25,6 +25,7 @@ import { import {DynmapProjection} from "@/leaflet/projection/DynmapProjection"; export type State = { + version: string; configuration: DynmapServerConfig; messages: DynmapMessageConfig; components: DynmapComponentConfig; @@ -55,6 +56,8 @@ export type State = { } export const state: State = { + version: process.env.PACKAGE_VERSION || 'Unknown', + configuration: { version: '', allowChat: false, diff --git a/vue.config.js b/vue.config.js index 6e60f75..df8d4b5 100644 --- a/vue.config.js +++ b/vue.config.js @@ -1,3 +1,9 @@ +const + webpack = require('webpack'), + fs = require('fs'), + packageJson = fs.readFileSync('./package.json'), + version = JSON.parse(packageJson).version || 'Unknown'; + module.exports = { publicPath: '', assetsDir: 'live-atlas', @@ -11,6 +17,16 @@ module.exports = { } }, + configureWebpack: { + plugins: [ + new webpack.DefinePlugin({ + 'process.env': { + PACKAGE_VERSION: '"' + version + '"' + } + }) + ] + }, + chainWebpack: config => { config.plugin('html') .tap(args => {