feat: add version and bump pakcages

This commit is contained in:
2025-02-23 12:17:02 +08:00
parent 4e080a0b93
commit 70b6881a38
7 changed files with 187 additions and 172 deletions

View File

@@ -6,7 +6,10 @@ import path from 'path';
import esbuild from 'rollup-plugin-esbuild';
import alias from '@rollup/plugin-alias';
import replace from '@rollup/plugin-replace';
import pkgs from './package.json' with { type: 'json' };
const isDev = process.env.NODE_ENV === 'development';
const version = pkgs.version|| '1.0.0';
/**
* @type {import('rollup').RollupOptions}
*/
@@ -22,6 +25,7 @@ const config = {
replace({
preventAssignment: true, // 防止意外赋值
DEV_SERVER: JSON.stringify(isDev), // 替换 process.env.NODE_ENV
VERSION: JSON.stringify(version), // 替换版本号
}),
alias({
// only esbuild needs to be configured