mirror of
https://github.com/iflytek/skillhub.git
synced 2026-10-03 02:24:36 +00:00
feat : 调整适配部署阿里云效
This commit is contained in:
parent
1dabd01ba7
commit
ed85823e16
3 changed files with 4 additions and 1 deletions
|
|
@ -4,6 +4,7 @@ WORKDIR /app
|
|||
COPY package.json pnpm-lock.yaml ./
|
||||
RUN pnpm install --frozen-lockfile
|
||||
COPY . .
|
||||
ENV VITE_BASE_PATH=/skillhub-web/
|
||||
RUN pnpm build
|
||||
|
||||
FROM jsessh-registry.cn-shanghai.cr.aliyuncs.com/base-images/nginx-skillhub:alpine
|
||||
|
|
|
|||
|
|
@ -7,7 +7,8 @@
|
|||
async function loadRuntimeConfig() {
|
||||
await new Promise<void>((resolve, reject) => {
|
||||
const script = document.createElement('script')
|
||||
script.src = '/runtime-config.js'
|
||||
const base = new URL('./', document.baseURI).pathname
|
||||
script.src = `${base}runtime-config.js`
|
||||
script.async = false
|
||||
script.onload = () => resolve()
|
||||
script.onerror = () => reject(new Error('Failed to load runtime config'))
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ import react from '@vitejs/plugin-react'
|
|||
import * as path from 'path'
|
||||
|
||||
export default defineConfig({
|
||||
base: process.env.VITE_BASE_PATH || '/',
|
||||
plugins: [react()],
|
||||
resolve: {
|
||||
alias: {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue