Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: When the Explorer is deployed in production, remove the HashRouter #502

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/explorer-deploy-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ jobs:

- name: Build
if: steps.check-changes.outputs.changed == 'true'
run: pnpm run build
run: pnpm run build:netlify
env:
VITE_WALLETCONNECT_PROJECT_ID: ${{ secrets.VITE_WALLETCONNECT_PROJECT_ID }}
VITE_INFURA_API_KEY: ${{ secrets.VITE_INFURA_API_KEY }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/explorer-deploy-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
run: pnpm install --frozen-lockfile

- name: Build
run: pnpm run build
run: pnpm run build:netlify
env:
VITE_WALLETCONNECT_PROJECT_ID: ${{ secrets.VITE_WALLETCONNECT_PROJECT_ID }}
VITE_INFURA_API_KEY: ${{ secrets.VITE_INFURA_API_KEY }}
Expand Down
4 changes: 3 additions & 1 deletion explorer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,11 @@
"type": "module",
"scripts": {
"build": "tsc && vite build",
"build:netlify": "pnpm run build && pnpm run redirect",
"dev": "vite",
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
"preview": "vite preview"
"preview": "vite preview",
"redirect": "touch dist/_redirects && echo '/* /index.html 200' >> dist/_redirects"
},
"dependencies": {
"@radix-ui/react-dropdown-menu": "^2.0.6",
Expand Down
4 changes: 2 additions & 2 deletions explorer/src/routes/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Route, createHashRouter, createRoutesFromElements } from "react-router-dom";
import { Route, createBrowserRouter, createRoutesFromElements } from "react-router-dom";

import { Attestation } from "@/pages/Attestation";
import { Attestations } from "@/pages/Attestations";
Expand All @@ -17,7 +17,7 @@ import { loaderNetworkProvider } from "@/providers/network-provider/loader";
import { APP_ROUTES } from "./constants";
import { NotFoundPage } from "./NotFoundPage";

export const router = createHashRouter(
export const router = createBrowserRouter(
createRoutesFromElements(
<Route element={<Providers />} loader={loaderNetworkProvider}>
<Route path={APP_ROUTES.HOME} element={<Home />} />
Expand Down
Loading