File tree Expand file tree Collapse file tree 2 files changed +11
-4
lines changed
Expand file tree Collapse file tree 2 files changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -30,8 +30,11 @@ export async function build(
3030) {
3131 const start = Date . now ( )
3232
33- // @ts -ignore only exists for rolldown-vite
34- if ( vite . rolldownVersion ) {
33+ if (
34+ ! vite . version . startsWith ( '8.' ) &&
35+ // @ts -ignore only exists for rolldown-vite
36+ vite . rolldownVersion
37+ ) {
3538 try {
3639 await import ( 'oxc-minify' )
3740 } catch {
Original file line number Diff line number Diff line change @@ -265,8 +265,12 @@ function renderAttrs(attrs: Record<string, string>): string {
265265}
266266
267267async function minifyScript ( code : string , filename : string ) : Promise < string > {
268- // @ts -ignore use oxc-minify when rolldown-vite is used
269- if ( vite . rolldownVersion ) {
268+ if ( vite . version . startsWith ( '8.' ) ) {
269+ // @ts -ignore minify is available in vite 8
270+ const minify = vite . minify
271+ return ( await minify ( filename , code ) ) . code . trim ( )
272+ // @ts -ignore use oxc-minify when rolldown-vite is used
273+ } else if ( vite . rolldownVersion ) {
270274 const oxcMinify = await import ( 'oxc-minify' )
271275 return ( await oxcMinify . minify ( filename , code ) ) . code . trim ( )
272276 }
You can’t perform that action at this time.
0 commit comments