20.9.0
export default defineConfig(({ mode }) => {
return {
base: mode == 'production' ? '/vue3-vite/' : './',
plugins: [
vue(),
],
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url))
}
}
};
});
<link rel="icon" href="/favicon.ico">
<script type="module" src="/src/main.js"></script>
#!/usr/bin/env sh
# 发生错误时终止
set -e
# 构建
npm run build
# 提交main主分支
git add .
git commit -m "提交更新main分支"
git push origin main
# 进入dist文件夹
cd dist
# 提交gh-pages主分支
git add .
git commit -m "提交部署gh-pages分支"
git push origin gh-pages
# 按任意键关闭
echo "按任意键关闭"
read -n 1
# 关闭sh脚本
exit 0
``