diff --git a/netlify.toml b/netlify.toml new file mode 100644 index 0000000..57ba3d3 --- /dev/null +++ b/netlify.toml @@ -0,0 +1,4 @@ +[[redirects]] +from = ":/*" +to = "/index.html" +status = 200 diff --git a/vite.config.js b/vite.config.js index b1b5f91..d74e089 100644 --- a/vite.config.js +++ b/vite.config.js @@ -2,6 +2,12 @@ import { defineConfig } from 'vite' import react from '@vitejs/plugin-react' // https://vitejs.dev/config/ -export default defineConfig({ +let config = { plugins: [react()] -}) +}; +// this will be undefined when deployed from netlify, but is used by gh-pages +if (process.env.GITHUB_REPOSITORY_OWNER) { + config.base = `https://${process.env.GITHUB_REPOSITORY_OWNER}.github.io/ome-ngff-validator/`; +} + +export default defineConfig(config);