DeployHelperFront/test-build.js

26 lines
873 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');
console.log('🧪 开始测试 DeployHelper 前端项目...\n');
try {
// 检查依赖是否安装
console.log('📦 检查依赖...');
execSync('npm list --depth=0', { stdio: 'inherit' });
console.log('✅ 依赖检查通过\n');
// 检查构建
console.log('🔨 测试构建...');
execSync('npm run build', { stdio: 'inherit' });
console.log('✅ 构建测试通过\n');
console.log('🎉 所有测试通过!项目可以正常运行。');
console.log('\n📝 使用说明:');
console.log('1. 开发模式npm run dev');
console.log('2. 构建生产版本npm run build');
console.log('3. 预览构建结果npm run preview');
console.log('\n🌐 访问地址http://localhost:3000');
} catch (error) {
console.error('❌ 测试失败:', error.message);
process.exit(1);
}