|
@@ -1,6 +1,7 @@
|
|
|
import { UserConfig, ConfigEnv, loadEnv, defineConfig } from 'vite';
|
|
|
import createPlugins from './vite/plugins';
|
|
|
import path from 'path';
|
|
|
+import version from 'vite-plugin-package-version';
|
|
|
const timeStamp = new Date().getTime();
|
|
|
export default defineConfig(({ mode, command }: ConfigEnv): UserConfig => {
|
|
|
const env = loadEnv(mode, process.cwd());
|
|
@@ -14,7 +15,7 @@ export default defineConfig(({ mode, command }: ConfigEnv): UserConfig => {
|
|
|
extensions: ['.mjs', '.js', '.ts', '.jsx', '.tsx', '.json', '.vue']
|
|
|
},
|
|
|
// https://cn.vitejs.dev/config/#resolve-extensions
|
|
|
- plugins: createPlugins(env, command === 'build'),
|
|
|
+ plugins: [createPlugins(env, command === 'build'),version()],
|
|
|
define: {
|
|
|
__VITE_GIT_HASH__: JSON.stringify(process.env.VITE_GIT_HASH),
|
|
|
},
|