Skip to content

Commit

Permalink
build: update build command for GitHub Pages deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
ATQQ committed Jan 21, 2024
1 parent e1da68c commit 48276de
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 17 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/client.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@ jobs:
run: |
echo ${{ github.workspace }}
cd ./packages/client
pnpm build
pnpm build:github
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./packages/client/dist # 文档打包产物的目录名就是build
user_name: 'github-actions[bot]'
user_email: 'github-actions[bot]@users.noreply.github.com'
commit_message: ${{ github.event.head_commit.message }}
commit_message: ${{ github.event.head_commit.message }}`
1 change: 1 addition & 0 deletions packages/client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"scripts": {
"dev": "vite",
"build": "vite build",
"build:github": "vite build --base /image-bed-qiniu/",
"preview": "vite preview",
"lint": "eslint .",
"lint:fix": "eslint . --fix",
Expand Down
30 changes: 15 additions & 15 deletions packages/client/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,26 +18,26 @@ export default defineConfig({
vueJsx(),
// Element Plus 的UI按需引入配置
AutoImport({
resolvers: [ElementPlusResolver()]
resolvers: [ElementPlusResolver()],
}),
Components({
resolvers: [ElementPlusResolver()]
resolvers: [ElementPlusResolver()],
}),
ElementPlus({
defaultLocale: 'zh-cn'
})
defaultLocale: 'zh-cn',
}),
],
test: {
globals: true,
environment: 'jsdom',
exclude: [...configDefaults.exclude, 'e2e/*'],
root: fileURLToPath(new URL('./', import.meta.url))
root: fileURLToPath(new URL('./', import.meta.url)),
},
optimizeDeps: {
include: ['vue', 'vue-router', 'pinia', 'axios']
include: ['vue', 'vue-router', 'pinia', 'axios'],
},
build: {
sourcemap: true
sourcemap: true,
},
server: {
port: 8080,
Expand All @@ -47,23 +47,23 @@ export default defineConfig({
target:
'https://service-rbji0bev-1256505457.cd.apigw.tencentcs.com/release',
changeOrigin: true,
rewrite: p => p.replace(/^\/api/, '')
rewrite: p => p.replace(/^\/api/, ''),
},
'/api-prod/': {
target: 'http://localhost:3001',
changeOrigin: true,
rewrite: p => p.replace(/^\/api-prod/, '')
rewrite: p => p.replace(/^\/api-prod/, ''),
},
'/api-test/': {
target: 'http://localhost:3001',
changeOrigin: true,
rewrite: p => p.replace(/^\/api-test/, '')
}
}
rewrite: p => p.replace(/^\/api-test/, ''),
},
},
},
resolve: {
alias: {
'@': path.resolve(__dirname, './src')
}
}
'@': path.resolve(__dirname, './src'),
},
},
})

0 comments on commit 48276de

Please sign in to comment.