Skip to content

Commit e4c6f3a

Browse files
committed
Updates for deploying to github pages.
1 parent 524ccbd commit e4c6f3a

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
"scripts": {
3232
"start": "vite",
3333
"production": "json-server --watch src/db.json -p 3000 --host 0.0.0.0 --static build",
34-
"build": "node build",
34+
"build": "vite build",
3535
"test": "react-scripts test --env=jsdom",
3636
"eject": "react-scripts eject",
3737
"lint": "eslint \"**/*.{js,jsx}\"",

src/components/App.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import theme from '../containers/styles/theme';
1111
import { SettingsContext } from '../containers/ContextProvider/SettingsProvider';
1212
import { actionTypes } from '../containers/ContextProvider/reducer';
1313

14-
const isGhPages = process.env.VITE_GH_PAGES === 'true';
14+
const isGhPages = process.env.VITE_GH_PAGES.trim() === 'true';
1515
const Router = isGhPages ? HashRouter : BrowserRouter;
1616
const redirect = isGhPages ? '/request-generator/#/index' : '/index';
1717
const App = () => {

vite.config.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,8 @@ export default defineConfig({
2121
open: false,
2222
host: true
2323
},
24-
})
24+
build: {
25+
outDir: 'build',
26+
emptyOutDir: true, // also necessary
27+
},
28+
})

0 commit comments

Comments
 (0)