Skip to content

Commit c1b9cee

Browse files
committed
Using Browser Router for prod
1 parent 27a1b11 commit c1b9cee

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

.github/workflows/deploy.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ jobs:
3737
start: npm run preview
3838
wait-on: 'http://localhost:5173'
3939
browser: chrome
40+
env:
41+
CYPRESS_BASE_URL: http://localhost:5173/ab-test-calculator-link/
4042

4143
build:
4244
runs-on: ubuntu-latest

cypress.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { defineConfig } from 'cypress';
22

33
export default defineConfig({
44
e2e: {
5-
baseUrl: process.env.CYPRESS_BASE_URL || 'http://localhost:5173',
5+
baseUrl: process.env.CYPRESS_BASE_URL,
66
supportFile: false,
77
specPattern: 'cypress/e2e/**/*.cy.{js,jsx,ts,tsx}',
88
setupNodeEvents(on, config) {

src/main.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import React from 'react';
22
import ReactDOM from 'react-dom/client';
3-
import { BrowserRouter, HashRouter } from 'react-router-dom';
3+
import { BrowserRouter } from 'react-router-dom';
44
import App from './App';
55
import './index.css';
66

7-
const Router = process.env.NODE_ENV === 'production' ? HashRouter : BrowserRouter;
7+
const Router = BrowserRouter;
88

99
ReactDOM.createRoot(document.getElementById('root')!).render(
1010
<React.StrictMode>

0 commit comments

Comments
 (0)