Skip to content

Commit b8bc99f

Browse files
committed
add base-href
1 parent 45d0ef5 commit b8bc99f

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

.github/workflows/pages-deploy.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ jobs:
3636
curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
3737
wasm-pack build string-bean-wasm --target web
3838
- name: Build Web
39+
env:
40+
BASE_HREF: '/string-bean'
3941
run: |
4042
cd web
4143
npm i && npm run build

web/svelte.config.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import adapter from '@sveltejs/adapter-static';
22
import { vitePreprocess } from '@sveltejs/kit/vite';
33

4+
const base = process.env.BASE_HREF ?? '';
5+
46
/** @type {import('@sveltejs/kit').Config} */
57
const config = {
68
kit: {
@@ -11,9 +13,13 @@ const config = {
1113
pages: 'build',
1214
assets: 'build',
1315
precompress: false,
14-
strict: true
15-
})
16+
strict: true,
17+
}),
18+
paths: {
19+
base
20+
}
1621
},
22+
1723
preprocess: vitePreprocess(),
1824
};
1925

0 commit comments

Comments
 (0)