diff --git a/package.json b/package.json index 6785f3a..a246008 100644 --- a/package.json +++ b/package.json @@ -1,12 +1,13 @@ { "name": "testing-playground", + "homepage": "/testing-playground/#", "private": true, "version": "1.0.0", "type": "module", "scripts": { - "dev": "vite", + "dev": "NODE_ENV=development vite", "build": "tsc && vite build", - "preview": "vite preview", + "preview": "NODE_ENV=development vite preview", "prepare": "husky install", "test": "vitest" }, diff --git a/src/Main.tsx b/src/Main.tsx index 7ef1702..24bbb01 100644 --- a/src/Main.tsx +++ b/src/Main.tsx @@ -2,7 +2,7 @@ import { ThemeProvider } from '@emotion/react' import * as React from 'react' import * as ReactDOM from 'react-dom/client' import { I18nextProvider } from 'react-i18next' -import { BrowserRouter } from 'react-router-dom' +import { HashRouter } from 'react-router-dom' import i18n from './i18n/i18nConfig' import Router from './Router' @@ -15,11 +15,11 @@ if (rootElement !== null) { - + - + - , + ) } diff --git a/tsconfig.json b/tsconfig.json index 703b198..2b469f4 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -15,6 +15,10 @@ "skipLibCheck": true, "strict": true, "target": "ESNext", + "types": [ + "react", + "vite/client" + ], "useDefineForClassFields": true }, "include": [ diff --git a/vite.config.ts b/vite.config.ts index 62dbb13..785c99c 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -2,7 +2,7 @@ import react from '@vitejs/plugin-react' import { defineConfig } from 'vite' export default defineConfig({ - base: '/testing-playground', + base: process.env.NODE_ENV === 'production' ? '/testing-playground/#' : '/#', build: { minify: false },