Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,12 +99,12 @@ the Vite headers.

## Deployment

This app is published to GitHub Pages at the `/glpython/` sub-path (see the
`base` option in `vite.config.ts`). Because `vite preview` doesn't serve the
build under that sub-path by default, locally previewing the exact production
layout requires serving `dist/` from a path ending in `/glpython/` (for
example via a symlink into a static file server), rather than running
`npm run preview` directly at the site root.
Every push to `main` publishes the app to GitHub Pages at the organization's
root, <https://glpython-edu.github.io/> (the repo is named
`glpython-edu.github.io`). `npm run build && npm run preview` serves the same
layout locally. The embed for LiaScript courses lives next to it, at
<https://glpython-edu.github.io/glpython-editor/>, deployed from
glpython-editor.

## Next integration step

Expand Down
10 changes: 5 additions & 5 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ const crossOriginIsolationHeaders = {
}

// https://vite.dev/config/
export default defineConfig(({ command }) => ({
// GitHub Pages serves this project from /glpython/, so assets and the
// Pyodide worker need to be requested under that base path in production.
base: command === 'build' ? '/glpython/' : '/',
// The repo is glpython-edu/glpython-edu.github.io, so GitHub Pages serves the
// IDE at the organization's root, https://glpython-edu.github.io/, and Vite's
// default base "/" applies in production too.
export default defineConfig({
plugins: [react()],
// glpython-editor's Pyodide worker is loaded via
// `new Worker(new URL('./pyodide-worker.js', import.meta.url))`, resolved
Expand All @@ -31,4 +31,4 @@ export default defineConfig(({ command }) => ({
preview: {
headers: crossOriginIsolationHeaders,
},
}))
})
Loading