Skip to content

feat(vite): migrate to rolldown-vite and reconfigure for optimization (nested for #169) #171

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft
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 apps/client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@
"unocss-preset-shadcn": "0.5.0",
"unplugin-vue-router": "0.12.0",
"unplugin-vue-router-extend": "0.1.15",
"vite": "^6.3.4",
"vite": "npm:rolldown-vite@latest",
"vite-plugin-image-optimizer": "1.1.8",
"vite-plugin-vue-devtools": "^7.7.6",
"vitest": "^1.6.1",
Expand Down
10 changes: 9 additions & 1 deletion apps/client/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { defineConfig, loadEnv } from 'vite'
import vueDevTools from 'vite-plugin-vue-devtools'
import { ViteImageOptimizer } from 'vite-plugin-image-optimizer'
import Sonda from 'sonda/vite'
import type { PluginOption } from 'vite'

// fix: uvr v0.11.2
const routeMap = new Map<string, any>()
Expand Down Expand Up @@ -54,12 +55,16 @@ export default defineConfig(({ mode }) => {
format: 'html',
filename: 'bundle-analyzer.html',
gzip: true,
}),
// disable: not compatible with rolldown-vite
}) as unknown as PluginOption,
vue(),
],
define: {
__BUILD_ANALYZER__: JSON.stringify(env.BUILD_ANALYZER),
},
worker: {
format: 'es',
},
build: {
sourcemap: !!env.BUILD_ANALYZER,
},
Expand All @@ -68,6 +73,9 @@ export default defineConfig(({ mode }) => {
errorRecovery: true,
},
},
experimental: {
enableNativePlugin: mode === 'development' ? false : 'resolver',
},
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url)),
Expand Down
Loading