This template should help get you started developing with Vue 3 in Vite. The template uses Vue 3 <script setup>
SFCs, check out the script setup docs to learn more.
前端部署到服务器,没有依赖ci/cd。通过执行脚本、一键编译、scp上传到服务器,同时做备份操作。 解放前端简单部署,只需一键搞定
本demo可以移植react、vue项目中
yarn add child_process babel-node babel-core babel-preset-es2015 babel-preset-env babel-cli scp2
{
"presets": [
"env"
],
"plugins": []
}
/scripts/config/deployConfig.js
在package.json中添加启动
"dev-build-deploy": "babel-node ./scripts/build.js && babel-node ./scripts/deploy.js dev",
"pro-build-deploy": "babel-node ./scripts/build.js && babel-node ./scripts/deploy.js pro"
await execCmd('vite build') ; //看当前项目用哪个指令build就替换下