fix(vite-plugins): 仅在生产环境构建时更新package.json
This commit is contained in:
parent
968a090876
commit
c6d4a46968
@ -7,6 +7,9 @@ const updatePackageJson = (): Plugin => {
|
|||||||
return {
|
return {
|
||||||
name: 'update-package-json',
|
name: 'update-package-json',
|
||||||
async buildStart() {
|
async buildStart() {
|
||||||
|
// 只在生产环境构建时执行
|
||||||
|
if (process.env.NODE_ENV !== 'production') return
|
||||||
|
|
||||||
const packageJsonPath = path.resolve(process.cwd(), 'package.json')
|
const packageJsonPath = path.resolve(process.cwd(), 'package.json')
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user