WSL/SLF GitLab Repository

Commit cbae2f18 authored by Haas's avatar Haas
Browse files

fix(vite.config.js): fixed resolving of version from package.json

parent 8270d655
Pipeline #1553 failed with stages
in 16 seconds
......@@ -674,7 +674,7 @@ export default {
dialogMessage: '',
dialogCallback: () => {},
redirectToDashboard: false,
appVersion: process.env.VITE_VERSION,
appVersion: import.meta.env.VITE_VERSION,
showMenu: true,
NavToolbarZIndex: 1150,
NavigationZIndex: 1100,
......
......@@ -11,10 +11,10 @@ import { viteStaticCopy } from 'vite-plugin-static-copy';
import ViteRequireContext from '@originjs/vite-plugin-require-context';
import { VitePluginFonts } from 'vite-plugin-fonts';
import { version } from './package.json';
// TODO exposing package.json to app is potential security risk
import { getFilesWithPrefix } from './src/factories/enhancementsFactoryNode';
const version = process.env.npm_package_version;
export default ({ mode }) => {
const isProd = mode === 'production'
......@@ -92,6 +92,7 @@ export default ({ mode }) => {
],
define: {
'process.env': loadEnv(mode, process.cwd()),
'import.meta.env.VITE_VERSION': JSON.stringify(version),
},
optimizeDeps: {
include: ['vuetify', 'vuex-persist'],
......@@ -113,6 +114,9 @@ export default ({ mode }) => {
cssCodeSplit: true,
// sourcemap: true,
emptyOutDir: true,
define: {
'import.meta.env.VITE_VERSION': JSON.stringify(version),
},
},
server: {
host: '0.0.0.0',
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment