ZAPlayer/install-deps.js
2026-01-30 11:24:39 +08:00

26 lines
730 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// 依赖安装检查脚本
const { execSync } = require('child_process');
const fs = require('fs');
const path = require('path');
console.log('检查并安装必要的依赖...');
try {
// 检查package.json是否存在
if (!fs.existsSync('package.json')) {
console.error('package.json 不存在!');
process.exit(1);
}
// 安装terser如果需要高级压缩功能
console.log('安装 terser...');
execSync('npm install --save-dev terser', { stdio: 'inherit' });
console.log('依赖安装完成!');
console.log('可以运行以下命令进行构建:');
console.log(' npm run build:min');
} catch (error) {
console.error('依赖安装失败:', error.message);
process.exit(1);
}