Skip to content

Commit 260461c

Browse files
authored
chore: add _VERSION_ (#4203)
1 parent d82d888 commit 260461c

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

packages/tdesign-react/site/vite.config.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@ import react from '@vitejs/plugin-react';
22
import path, { dirname } from 'path';
33
import { fileURLToPath } from 'url';
44
import { defineConfig } from 'vite';
5-
65
import { VitePWA } from 'vite-plugin-pwa';
6+
import pkg from '../package.json';
7+
78
import pwaConfig from './pwaConfig';
89

910
import changelog2Json from './plugins/changelog-to-json';
@@ -31,6 +32,9 @@ const disableTreeShakingPlugin = (paths) => ({
3132
export default ({ mode }) =>
3233
defineConfig({
3334
base: publicPathMap[mode],
35+
define: {
36+
__VERSION__: JSON.stringify(pkg.version),
37+
},
3438
resolve: {
3539
alias: {
3640
'tdesign-react/es': path.resolve(__dirname, '../../components'),

0 commit comments

Comments
 (0)