Skip to content
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 package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"scripts": {
"start": "vite",
"production": "json-server --watch src/db.json -p 3000 --host 0.0.0.0 --static build",
"build": "node build",
"build": "vite build",
"test": "react-scripts test --env=jsdom",
"eject": "react-scripts eject",
"lint": "eslint \"**/*.{js,jsx}\"",
Expand Down
3 changes: 2 additions & 1 deletion src/components/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@ import theme from '../containers/styles/theme';
import { SettingsContext } from '../containers/ContextProvider/SettingsProvider';
import { actionTypes } from '../containers/ContextProvider/reducer';

const isGhPages = process.env.VITE_GH_PAGES === 'true';
const isGhPages = process.env.VITE_GH_PAGES.trim() === 'true';
const Router = isGhPages ? HashRouter : BrowserRouter;
const redirect = isGhPages ? '/request-generator/#/index' : '/index';
console.log('redirect: ' + redirect);
const App = () => {
const [, dispatch] = React.useContext(SettingsContext);
useEffect(() => {
Expand Down
6 changes: 5 additions & 1 deletion vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,8 @@ export default defineConfig({
open: false,
host: true
},
})
build: {
outDir: 'build',
emptyOutDir: true, // also necessary
},
})
Loading