feat: add version and bump pakcages
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user