1
0
mirror of https://gitee.com/sui-feng-cb/AzurLaneAutoScript1 synced 2026-03-12 02:48:23 +08:00
This commit is contained in:
SevCrane
2024-06-05 23:20:28 +08:00
commit 5e482958f6
7329 changed files with 240086 additions and 0 deletions

View File

@@ -0,0 +1,9 @@
/**
* Entry function for get app version.
* In current implementation, it returns `version` from `package.json`, but you can implement any logic here.
* Runs several times for each vite configs and electron-builder config.
* @return {string}
*/
export function getVersion() {
return process.env.npm_package_version;
}

View File

@@ -0,0 +1,12 @@
import {getVersion} from './getVersion.mjs';
/**
* Somehow inject app version to vite build context
* @return {import('vite').Plugin}
*/
export const injectAppVersion = () => ({
name: 'inject-version',
config: () => {
process.env.VITE_APP_VERSION = getVersion();
},
});