File tree Expand file tree Collapse file tree 5 files changed +32
-9
lines changed
playground/rolldown-dev-react/src Expand file tree Collapse file tree 5 files changed +32
-9
lines changed Original file line number Diff line number Diff line change @@ -45,19 +45,20 @@ 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 &&
5658 Object . values ( config . environments ) . some (
5759 ( environment ) => ! isDepOptimizationDisabled ( environment . optimizeDeps ) ,
5860 )
5961 const enableNativePlugin = config . experimental . enableNativePlugin
60- const rolldownDev = config . experimental . rolldownDev
6162
6263 return [
6364 depOptimizationEnabled ? optimizedDepsPlugin ( ) : null ,
Original file line number Diff line number Diff line change @@ -182,10 +182,16 @@ class RolldownEnvironment extends DevEnvironment {
182182 plugins = plugins . filter (
183183 ( p ) =>
184184 ! ( typeof p . name === 'number' || p . name ?. startsWith ( 'vite:' ) ) ||
185- [ 'vite:define' , 'vite:build-html' , 'vite:build-metadata' ] . includes (
186- p . name ,
187- ) ||
188- [ 'AliasPlugin' , 'TransformPlugin' ] . includes ( p . constructor . name ) ,
185+ [
186+ 'vite:define' ,
187+ 'vite:build-html' ,
188+ 'vite:build-metadata' ,
189+ 'vite:css' ,
190+ 'vite:css-post' ,
191+ ] . includes ( p . name ) ||
192+ [ 'AliasPlugin' , 'TransformPlugin' , 'LoadFallbackPlugin' ] . includes (
193+ p . constructor . name ,
194+ ) ,
189195 )
190196 plugins = plugins . map ( ( p ) => injectEnvironmentToHooks ( this as any , p ) )
191197
Original file line number Diff line number Diff line change @@ -4,6 +4,8 @@ import virtualTest from 'virtual:test'
44// @ts -expect-error no type
55import testAlias from 'test-alias'
66import { throwError } from './error'
7+ import './test-style.css'
8+ import testStyleInline from './test-style-inline.css?inline'
79
810export function App ( ) {
911 const [ count , setCount ] = React . useState ( 0 )
@@ -17,8 +19,16 @@ export function App() {
1719 </ button >
1820 < pre > [virtual] { virtualTest } </ pre >
1921 < pre > [alias] { testAlias } </ pre >
20- { /* TODO: slightly broken probably due to patching rolldown:runtime during renderChunk */ }
22+ { /* TODO: source map is slightly broken probably due to patching rolldown:runtime during renderChunk */ }
2123 < button onClick = { ( ) => throwError ( ) } > stacktrace</ button >
24+ { /* TODO */ }
25+ < pre >
26+ [css] < span className = "test-style" > orange</ span >
27+ </ pre >
28+ < style > { testStyleInline } </ style >
29+ < pre >
30+ [css?inline] < span className = "test-style-inline" > orange</ span >
31+ </ pre >
2232 </ div >
2333 </ div >
2434 )
Original file line number Diff line number Diff line change 1+ .test-style-inline {
2+ color : orange;
3+ }
Original file line number Diff line number Diff line change 1+ .test-style {
2+ color : orange;
3+ }
You can’t perform that action at this time.
0 commit comments