mirror of
https://github.com/iib0011/omni-tools.git
synced 2025-11-05 08:24:56 +05:30
feat: support BASE_URL
This commit is contained in:
parent
234fc8090b
commit
614125002c
11 changed files with 29 additions and 23 deletions
|
|
@ -8,7 +8,6 @@
|
|||
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png" />
|
||||
<meta name="apple-mobile-web-app-title" content="OmniTools" />
|
||||
<link rel="manifest" href="/site.webmanifest" />
|
||||
<link href="/assets/fonts/quicksand/quick-sand.css" rel="stylesheet" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>OmniTools</title>
|
||||
</head>
|
||||
|
|
|
|||
|
Before Width: | Height: | Size: 140 KiB After Width: | Height: | Size: 140 KiB |
|
Before Width: | Height: | Size: 2 KiB After Width: | Height: | Size: 2 KiB |
|
|
@ -59,7 +59,7 @@ function App() {
|
|||
>
|
||||
<CustomSnackBarProvider>
|
||||
<UserTypeFilterProvider>
|
||||
<BrowserRouter>
|
||||
<BrowserRouter basename={import.meta.env.BASE_URL}>
|
||||
<Navbar
|
||||
mode={mode}
|
||||
onChangeMode={() => {
|
||||
|
|
|
|||
|
|
@ -34,7 +34,9 @@ i18n
|
|||
escapeValue: false // react already safes from xss => https://www.i18next.com/translation-function/interpolation#unescape
|
||||
},
|
||||
backend: {
|
||||
loadPath: '/locales/{{lng}}/{{ns}}.json'
|
||||
loadPath: `${
|
||||
(import.meta as any).env.BASE_URL?.replace(/\/$/, '') || ''
|
||||
}/locales/{{lng}}/{{ns}}.json`
|
||||
},
|
||||
detection: {
|
||||
lookupLocalStorage: 'lang',
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
import { createRoot } from 'react-dom/client';
|
||||
import 'tailwindcss/tailwind.css';
|
||||
import 'assets/fonts/quicksand/quick-sand.css';
|
||||
import App from 'components/App';
|
||||
|
||||
const container = document.getElementById('root') as HTMLDivElement;
|
||||
|
|
|
|||
|
|
@ -4,6 +4,8 @@ import Categories from './Categories';
|
|||
import { Helmet } from 'react-helmet';
|
||||
import { useUserTypeFilter } from 'providers/UserTypeFilterProvider';
|
||||
import UserTypeFilter from '@components/UserTypeFilter';
|
||||
import backgroundDark from 'assets/background-dark.png';
|
||||
import backgroundLight from 'assets/background.svg';
|
||||
|
||||
export default function Home() {
|
||||
const theme = useTheme();
|
||||
|
|
@ -16,10 +18,8 @@ export default function Home() {
|
|||
lg: 5
|
||||
}}
|
||||
sx={{
|
||||
background: `url(/assets/${
|
||||
theme.palette.mode === 'dark'
|
||||
? 'background-dark.png'
|
||||
: 'background.svg'
|
||||
background: `url(${
|
||||
theme.palette.mode === 'dark' ? backgroundDark : backgroundLight
|
||||
})`,
|
||||
backgroundColor: 'background.default'
|
||||
}}
|
||||
|
|
|
|||
|
|
@ -1,22 +1,26 @@
|
|||
/// <reference types="vitest" />
|
||||
import { defineConfig } from 'vite';
|
||||
import { defineConfig, loadEnv } from 'vite';
|
||||
import react from '@vitejs/plugin-react-swc';
|
||||
import tsconfigPaths from 'vite-tsconfig-paths';
|
||||
|
||||
// https://vitejs.dev/config https://vitest.dev/config
|
||||
export default defineConfig({
|
||||
plugins: [react(), tsconfigPaths()],
|
||||
define: {
|
||||
'process.env': {}
|
||||
},
|
||||
optimizeDeps: {
|
||||
exclude: ['@ffmpeg/ffmpeg', '@ffmpeg/util']
|
||||
},
|
||||
test: {
|
||||
globals: true,
|
||||
environment: 'happy-dom',
|
||||
setupFiles: '.vitest/setup',
|
||||
include: ['**/*.test.{ts,tsx}']
|
||||
},
|
||||
worker: { format: 'es' }
|
||||
export default defineConfig(({ mode }) => {
|
||||
const env = loadEnv(mode, process.cwd(), '');
|
||||
return {
|
||||
base: env.BASE_URL || '/',
|
||||
plugins: [react(), tsconfigPaths()],
|
||||
define: {
|
||||
'process.env': {}
|
||||
},
|
||||
optimizeDeps: {
|
||||
exclude: ['@ffmpeg/ffmpeg', '@ffmpeg/util']
|
||||
},
|
||||
test: {
|
||||
globals: true,
|
||||
environment: 'happy-dom',
|
||||
setupFiles: '.vitest/setup',
|
||||
include: ['**/*.test.{ts,tsx}']
|
||||
},
|
||||
worker: { format: 'es' }
|
||||
};
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue