File tree Expand file tree Collapse file tree 3 files changed +193
-29
lines changed
Expand file tree Collapse file tree 3 files changed +193
-29
lines changed Original file line number Diff line number Diff line change @@ -83,13 +83,14 @@ export default defineBuildConfig({
8383 ) ;
8484 } ,
8585 rolldownOutput ( config ) {
86- config . codeSplitting ! . groups ?. unshift (
87- {
88- test : / s r c \/ b u i l d \/ ( p l u g i n s | v i r t u a l | \w + \. t s ) / ,
89- name : "_build/common" ,
90- } ,
91- { test : / s r c \/ ( u t i l s ) \/ / , name : "_chunks/utils" }
92- ) ;
86+ config . advancedChunks = { } ; // force overide obuild config for lib chunks
87+ // config.advancedChunks!.groups?.unshift(
88+ // {
89+ // test: /src\/build\/(plugins|virtual|\w+\.ts)/,
90+ // name: "_build/common",
91+ // },
92+ // { test: /src\/(utils)\//, name: "_chunks/utils" }
93+ // );
9394 config . chunkFileNames = ( chunk ) => {
9495 if ( chunk . name . startsWith ( "_" ) ) {
9596 return `[name].mjs` ;
@@ -100,6 +101,23 @@ export default defineBuildConfig({
100101 if ( chunk . name . startsWith ( "libs/" ) ) {
101102 return `_[name].mjs` ;
102103 }
104+ if ( chunk . moduleIds . every ( ( id ) => id . includes ( "node_modules" ) ) ) {
105+ const pkgNames = [
106+ ...new Set (
107+ chunk . moduleIds
108+ . map (
109+ ( id ) =>
110+ id . match (
111+ / .* \/ n o d e _ m o d u l e s \/ (?< package > @ [ ^ / ] + \/ [ ^ / ] + | [ ^ / ] + ) /
112+ ) ?. groups ?. package
113+ )
114+ . filter ( Boolean )
115+ . map ( ( name ) => name ! . split ( "/" ) . pop ( ) ! )
116+ . filter ( Boolean )
117+ ) ,
118+ ] . sort ( ) ;
119+ return `_libs/${ pkgNames . join ( "+" ) || "_" } .mjs` ;
120+ }
103121 if ( chunk . moduleIds . every ( ( id ) => / s r c \/ c l i \/ / . test ( id ) ) ) {
104122 return `cli/_chunks/[name].mjs` ;
105123 }
Original file line number Diff line number Diff line change 7474 "consola" : " ^3.4.2" ,
7575 "crossws" : " ^0.4.3" ,
7676 "db0" : " ^0.3.4" ,
77- "h3" : " ^2.0.1-rc.10 " ,
77+ "h3" : " ^2.0.1-rc.11 " ,
7878 "jiti" : " ^2.6.1" ,
7979 "nf3" : " ^0.3.5" ,
8080 "ofetch" : " ^2.0.0-alpha.3" ,
143143 "miniflare" : " ^4.20260114.0" ,
144144 "mlly" : " ^1.8.0" ,
145145 "nypm" : " ^0.6.2" ,
146- "obuild" : " ^0.4.16 " ,
146+ "obuild" : " ^0.4.17 " ,
147147 "pathe" : " ^2.0.3" ,
148148 "perfect-debounce" : " ^2.0.0" ,
149149 "pkg-types" : " ^2.3.0" ,
You can’t perform that action at this time.
0 commit comments