From 4580db69b3075aabbe13d6bfa894294ed34c999a Mon Sep 17 00:00:00 2001 From: William Moore Date: Fri, 10 Feb 2023 16:29:07 +0000 Subject: [PATCH] Add vite and netlify configs --- netlify.toml | 4 ++++ vite.config.js | 10 ++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 netlify.toml 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);