From 2d9e46554e9bc610e9117abd1519171ed0829bf8 Mon Sep 17 00:00:00 2001 From: Agusx1211 Date: Wed, 8 Nov 2023 15:06:18 +0000 Subject: [PATCH] Fix build base --- package.json | 1 + src/main.tsx | 4 ++-- vite.config.ts | 4 +++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index a3ebabb..2d98263 100644 --- a/package.json +++ b/package.json @@ -3,6 +3,7 @@ "private": true, "version": "0.0.0", "type": "module", + "homepage": "https://0xsequence.github.io/demo-waas-auth/", "scripts": { "dev": "vite", "build": "tsc && vite build", diff --git a/src/main.tsx b/src/main.tsx index 943cf05..50c999f 100644 --- a/src/main.tsx +++ b/src/main.tsx @@ -2,7 +2,7 @@ import React from 'react' import ReactDOM from 'react-dom/client' import '@0xsequence/design-system/styles.css' import { ThemeProvider } from '@0xsequence/design-system' -import { createBrowserRouter, RouterProvider } from 'react-router-dom' +import { createHashRouter, RouterProvider } from 'react-router-dom' import Login from './Login.tsx' import { GoogleOAuthProvider } from '@react-oauth/google' @@ -20,7 +20,7 @@ export const sequence = new Sequence({ key: 'eyJzZWNyZXQiOiJ0YmQiLCJ0ZW5hbnQiOjksImlkZW50aXR5UG9vbElkIjoidXMtZWFzdC0yOjQyYzlmMzlkLWM5MzUtNGQ1Yy1hODQ1LTVjODgxNWM3OWVlMyJ9', }, defaults.TEMPLATE_NEXT) -export const router = createBrowserRouter([ +export const router = createHashRouter([ { path: '/login', element: diff --git a/vite.config.ts b/vite.config.ts index 7d363bd..d918eea 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -4,5 +4,7 @@ import { vanillaExtractPlugin } from '@vanilla-extract/vite-plugin' // https://vitejs.dev/config/ export default defineConfig({ - plugins: [react(), vanillaExtractPlugin()] + plugins: [react(), vanillaExtractPlugin()], + // For github pages https://0xsequence.github.io/demo-waas-auth/ + base: '/demo-waas-auth/' })