Add version console log

This commit is contained in:
James Lyne 2020-12-17 15:24:40 +00:00
parent a4ec4c6790
commit b210f63638
3 changed files with 21 additions and 0 deletions

View File

@ -52,6 +52,8 @@ if(splash) {
});
}
console.info(`LiveAtlas version ${store.state.version}`);
const app = createApp(App).use(store);
// app.config.performance = true;

View File

@ -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,

View File

@ -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 => {