0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2024-12-16 20:26:19 -05:00

refactor: produce br outputs (#6376)

* refactor: produce br outputs

* refactor: fix favicon url
This commit is contained in:
Gao Sun 2024-08-06 22:08:36 +08:00 committed by GitHub
parent 241cea1605
commit a6002d5f19
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 27 additions and 6 deletions

View file

@ -41,6 +41,7 @@ const buildConfig = (mode: string): UserConfig => ({
react(),
svgr(),
viteCompression({ disable: mode === 'development' }),
viteCompression({ disable: mode === 'development', algorithm: 'brotliCompress' }),
],
define: {
'import.meta.env.IS_CLOUD': JSON.stringify(process.env.IS_CLOUD),

View file

@ -4,7 +4,7 @@
<head>
<meta charset="utf-8" />
<link rel="apple-touch-icon" sizes="180x180" href="./src/apple-touch-icon.png">
<link rel="icon" href="./src/ffavicon.ico" />
<link rel="icon" href="./src/favicon.ico" />
<title>Logto Live Preview</title>
</head>

View file

@ -31,6 +31,7 @@
"@silverhand/ts-config-react": "6.0.0",
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
"@vitejs/plugin-react": "^4.3.1",
"eslint": "^8.56.0",
"i18next": "^22.4.15",
"i18next-browser-languagedetector": "^8.0.0",
@ -43,6 +44,7 @@
"stylelint": "^15.0.0",
"typescript": "^5.5.3",
"vite": "^5.3.4",
"vite-plugin-compression": "^0.5.1",
"zod": "^3.23.8"
},
"engines": {

View file

@ -1,8 +1,10 @@
import { mergeConfig, type UserConfig } from 'vite';
import react from '@vitejs/plugin-react';
import { mergeConfig, defineConfig, type UserConfig } from 'vite';
import viteCompression from 'vite-plugin-compression';
import { defaultConfig } from '../../vite.shared.config';
const config: UserConfig = {
const buildConfig = (mode: string): UserConfig => ({
base: '/demo-app',
server: {
port: 5003,
@ -10,6 +12,11 @@ const config: UserConfig = {
port: 6003,
},
},
};
plugins: [
react(),
viteCompression({ disable: mode === 'development' }),
viteCompression({ disable: mode === 'development', algorithm: 'brotliCompress' }),
],
});
export default mergeConfig(defaultConfig, config);
export default defineConfig(({ mode }) => mergeConfig(defaultConfig, buildConfig(mode)));

View file

@ -20,7 +20,12 @@ const buildConfig = (mode: string): UserConfig => ({
mode === 'development' ? '__[hash:base64:5]__[local]' : '[hash:base64:5]_[local]',
},
},
plugins: [react(), svgr(), viteCompression({ disable: mode === 'development' })],
plugins: [
react(),
svgr(),
viteCompression({ disable: mode === 'development' }),
viteCompression({ disable: mode === 'development', algorithm: 'brotliCompress' }),
],
build: {
// Use the same browserslist configuration as in README.md.
// Consider using the esbuild target directly in the future.

View file

@ -3036,6 +3036,9 @@ importers:
'@types/react-dom':
specifier: ^18.3.0
version: 18.3.0
'@vitejs/plugin-react':
specifier: ^4.3.1
version: 4.3.1(vite@5.3.4(@types/node@20.12.7)(lightningcss@1.25.1)(sass@1.77.8))
eslint:
specifier: ^8.56.0
version: 8.57.0
@ -3072,6 +3075,9 @@ importers:
vite:
specifier: ^5.3.4
version: 5.3.4(@types/node@20.12.7)(lightningcss@1.25.1)(sass@1.77.8)
vite-plugin-compression:
specifier: ^0.5.1
version: 0.5.1(vite@5.3.4(@types/node@20.12.7)(lightningcss@1.25.1)(sass@1.77.8))
zod:
specifier: ^3.23.8
version: 3.23.8