-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Support subpath deployment #252
Conversation
src/server/components/script.tsx
Outdated
@@ -33,7 +33,7 @@ export const Script = (options: Options): any => { | |||
<script | |||
type='module' | |||
async={!!options.async} | |||
src={`/${scriptInManifest.file}`} | |||
src={`${import.meta.env.BASE_URL}${scriptInManifest.file}`} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we support without a trailing slash pattern?
defineConfig({
base: '/subdir' // does not have a trailing slash
})
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, that should be ensured
Hi @berlysia I think this approach is good. I've left a comment. |
0f87a8c
to
e187394
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Hey @berlysia ! Looks good! I'll merge this and release a new version. Thank you! |
fixes #243 partially
This PR enables deployment to subpaths such as GitHub Pages. See https://vite.dev/config/shared-options#base https://vite.dev/guide/env-and-mode#env-variables