Skip to content

Commit

Permalink
refactor: produce br outputs (logto-io#6376)
Browse files Browse the repository at this point in the history
* refactor: produce br outputs

* refactor: fix favicon url
  • Loading branch information
gao-sun authored Aug 6, 2024
1 parent 241cea1 commit a6002d5
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 6 deletions.
1 change: 1 addition & 0 deletions packages/console/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
2 changes: 1 addition & 1 deletion packages/demo-app/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -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>

Expand Down
2 changes: 2 additions & 0 deletions packages/demo-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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": {
Expand Down
15 changes: 11 additions & 4 deletions packages/demo-app/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,22 @@
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,
hmr: {
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)));
7 changes: 6 additions & 1 deletion packages/experience/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
6 changes: 6 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit a6002d5

Please sign in to comment.