@@ -45,11 +45,13 @@ export async function resolvePlugins(
4545 normalPlugins : Plugin [ ] ,
4646 postPlugins : Plugin [ ] ,
4747) : Promise < Plugin [ ] > {
48+ const rolldownDev = config . experimental . rolldownDev
4849 const isBuild = config . command === 'build'
4950 const isWorker = config . isWorker
50- const buildPlugins = isBuild
51- ? await ( await import ( '../build' ) ) . resolveBuildPlugins ( config )
52- : { pre : [ ] , post : [ ] }
51+ const buildPlugins =
52+ isBuild || rolldownDev
53+ ? await ( await import ( '../build' ) ) . resolveBuildPlugins ( config )
54+ : { pre : [ ] , post : [ ] }
5355 const { modulePreload } = config . build
5456 const depOptimizationEnabled =
5557 ! isBuild &&
@@ -60,7 +62,7 @@ export async function resolvePlugins(
6062
6163 return [
6264 depOptimizationEnabled ? optimizedDepsPlugin ( ) : null ,
63- isBuild ? metadataPlugin ( ) : null ,
65+ rolldownDev || isBuild ? metadataPlugin ( ) : null ,
6466 ! isWorker ? watchPackageDataPlugin ( config . packageCache ) : null ,
6567 ! isBuild ? preAliasPlugin ( config ) : null ,
6668 enableNativePlugin
@@ -118,9 +120,18 @@ export async function resolvePlugins(
118120 htmlInlineProxyPlugin ( config ) ,
119121 cssPlugin ( config ) ,
120122 config . oxc !== false
121- ? enableNativePlugin
122- ? nativeTransformPlugin ( )
123- : oxcPlugin ( config )
123+ ? rolldownDev
124+ ? createBuiltinPluginWithEnvironmentSupport (
125+ 'native:transform' ,
126+ ( environment ) =>
127+ nativeTransformPlugin ( {
128+ reactRefresh :
129+ environment . name === 'client' && rolldownDev ?. reactRefresh ,
130+ } ) ,
131+ )
132+ : enableNativePlugin
133+ ? nativeTransformPlugin ( )
134+ : oxcPlugin ( config )
124135 : null ,
125136 enableNativePlugin
126137 ? nativeJsonPlugin ( {
@@ -141,7 +152,7 @@ export async function resolvePlugins(
141152 enableNativePlugin ? nativeWasmFallbackPlugin ( ) : wasmFallbackPlugin ( ) ,
142153 definePlugin ( config ) ,
143154 cssPostPlugin ( config ) ,
144- isBuild && buildHtmlPlugin ( config ) ,
155+ ( rolldownDev || isBuild ) && buildHtmlPlugin ( config ) ,
145156 workerImportMetaUrlPlugin ( config ) ,
146157 assetImportMetaUrlPlugin ( config ) ,
147158 ...buildPlugins . pre ,
0 commit comments