Skip to content

Commit

Permalink
Updated build to build specifically for the map subdirectory
Browse files Browse the repository at this point in the history
  • Loading branch information
jmbarne3 committed Jun 27, 2024
1 parent 0351b1d commit 1f23e69
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 2 deletions.
39 changes: 39 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-map-gl": "^7.1.7",
"react-router-dom": "^6.24.0",
"sass": "^1.76.0"
},
"devDependencies": {
Expand All @@ -37,5 +38,5 @@
"typescript": "^5.2.2",
"vite": "^5.2.0"
},
"homepage": "./map/"
"homepage": "/map/"
}
14 changes: 13 additions & 1 deletion src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,21 @@ import ReactDOM from 'react-dom/client'
import App from './App.tsx'
import 'mapbox-gl/dist/mapbox-gl.css';
import './index.scss'
import { RouterProvider, createBrowserRouter } from 'react-router-dom';

const router = createBrowserRouter([
{
path: '/',
element: (
<App />
)
},
], {
basename: import.meta.env.VITE_BASEURL
});

ReactDOM.createRoot(document.getElementById('root')!).render(
<React.StrictMode>
<App />
<RouterProvider router={router} />
</React.StrictMode>
)
1 change: 1 addition & 0 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@ import react from '@vitejs/plugin-react'

// https://vitejs.dev/config/
export default defineConfig({
// base: '/map/',
plugins: [react()],
})

0 comments on commit 1f23e69

Please sign in to comment.