Skip to content

Commit

Permalink
Change BrowserRouter to HashRouter
Browse files Browse the repository at this point in the history
  • Loading branch information
Respirayson committed Mar 8, 2024
1 parent db17df4 commit 4c6735d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
8 changes: 3 additions & 5 deletions src/main.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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(
<React.StrictMode>
<BrowserRouter basename={
import.meta.env.DEV ? '/' : '/comclub-website-2024/'
}>
<HashRouter>
<App />
</BrowserRouter>
</HashRouter>
</React.StrictMode>,
);
6 changes: 1 addition & 5 deletions vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,13 @@ export default defineConfig(({ command }) => {
},
},
)],
base: '/',
base: '/comclub-website-2024/',
css: {
postcss: {
plugins: [tailwindcss()],
},
},
};

if (command !== 'serve') {
config.base = '/comclub-website-2024/';
}

return config;
});

0 comments on commit 4c6735d

Please sign in to comment.