From 4c6735d60b5b62a218df5b943993f7425a8354b8 Mon Sep 17 00:00:00 2001 From: Respirayson Date: Sat, 9 Mar 2024 02:55:13 +0800 Subject: [PATCH] Change BrowserRouter to HashRouter --- src/main.jsx | 8 +++----- vite.config.js | 6 +----- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/src/main.jsx b/src/main.jsx index 5f5ce4a..1a92a1f 100644 --- a/src/main.jsx +++ b/src/main.jsx @@ -2,14 +2,12 @@ import React from 'react'; import ReactDOM from 'react-dom/client'; import App from './App.jsx'; import './index.css'; -import { BrowserRouter } from 'react-router-dom'; +import { HashRouter } from 'react-router-dom'; ReactDOM.createRoot(document.getElementById('root')).render( - + - + , ); diff --git a/vite.config.js b/vite.config.js index eccf3c6..0936feb 100644 --- a/vite.config.js +++ b/vite.config.js @@ -14,7 +14,7 @@ export default defineConfig(({ command }) => { }, }, )], - base: '/', + base: '/comclub-website-2024/', css: { postcss: { plugins: [tailwindcss()], @@ -22,9 +22,5 @@ export default defineConfig(({ command }) => { }, }; - if (command !== 'serve') { - config.base = '/comclub-website-2024/'; - } - return config; });