Skip to content

Commit 4506ebe

Browse files
committed
config build
1 parent 34a6b47 commit 4506ebe

File tree

2 files changed

+15
-4
lines changed

2 files changed

+15
-4
lines changed

.github/workflows/build.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ jobs:
1414

1515
runs-on: ubuntu-latest
1616

17+
env:
18+
VITE_BASE: /ArknightsStoryTextReader/
19+
1720
steps:
1821
- uses: actions/checkout@v2
1922
- uses: actions/checkout@v2

reader/vite.config.js

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,19 @@
1-
import { defineConfig } from 'vite'
1+
import { defineConfig, loadEnv } from 'vite'
22
const { resolve } = require('path')
33
import vue from '@vitejs/plugin-vue'
44

55
// https://vitejs.dev/config/
6-
export default defineConfig({
6+
export default defineConfig(({command, mode}) => {
7+
8+
const env = loadEnv(mode, process.cwd(), '')
9+
var base = env.VITE_BASE;
10+
if(!base){
11+
base = '/';
12+
}
13+
14+
return{
715
plugins: [vue()],
8-
base: '/ArknightsStoryTextReader/',
16+
base: base,
917
build: {
1018
rollupOptions: {
1119
input: {
@@ -22,4 +30,4 @@ export default defineConfig({
2230
strict:false
2331
}
2432
}
25-
})
33+
}})

0 commit comments

Comments
 (0)