File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -44,14 +44,19 @@ function config (userConfig: UserConfig, env: ConfigEnv): UserConfig {
4444 if ( typeof rollupInput === 'string' )
4545 rollupInput = { [ rollupInput ] : rollupInput }
4646
47+ // Detect if we're using rolldown
48+ // @ts -ignore - Vite plugin context provides meta information
49+ const isUsingRolldown = this . meta && this . meta . rolldownVersion ;
50+ const optionsKey = isUsingRolldown ? "rolldownOptions" : "rollupOptions" ;
51+
4752 const build = {
4853 emptyOutDir : userConfig . build ?. emptyOutDir ?? ( ssrBuild || isLocal ) ,
4954 sourcemap : ! isLocal ,
5055 ...userConfig . build ,
5156 assetsDir,
5257 manifest : ! ssrBuild ,
5358 outDir,
54- rollupOptions : {
59+ [ optionsKey ] : {
5560 ...rollupOptions ,
5661 input : {
5762 ...rollupInput ,
@@ -101,6 +106,7 @@ function configureServer (server: ViteDevServer) {
101106function outputOptions ( assetsDir : string , ssrBuild : boolean ) {
102107 // Internal: Avoid nesting entrypoints unnecessarily.
103108 const outputFileName = ( ext : string ) => ( { name } : { name : string } ) => {
109+ if ( typeof name === "undefined" ) return "" ;
104110 const shortName = basename ( name ) . split ( '.' ) [ 0 ]
105111 return posix . join ( assetsDir , `${ shortName } -[hash].${ ext } ` )
106112 }
You can’t perform that action at this time.
0 commit comments