File tree 5 files changed +32
-9
lines changed
playground/rolldown-dev-react/src
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(
45
45
normalPlugins : Plugin [ ] ,
46
46
postPlugins : Plugin [ ] ,
47
47
) : Promise < Plugin [ ] > {
48
+ const rolldownDev = config . experimental . rolldownDev
48
49
const isBuild = config . command === 'build'
49
50
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 : [ ] }
53
55
const { modulePreload } = config . build
54
56
const depOptimizationEnabled =
55
57
! isBuild &&
56
58
Object . values ( config . environments ) . some (
57
59
( environment ) => ! isDepOptimizationDisabled ( environment . optimizeDeps ) ,
58
60
)
59
61
const enableNativePlugin = config . experimental . enableNativePlugin
60
- const rolldownDev = config . experimental . rolldownDev
61
62
62
63
return [
63
64
depOptimizationEnabled ? optimizedDepsPlugin ( ) : null ,
Original file line number Diff line number Diff line change @@ -182,10 +182,16 @@ class RolldownEnvironment extends DevEnvironment {
182
182
plugins = plugins . filter (
183
183
( p ) =>
184
184
! ( 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
+ ) ,
189
195
)
190
196
plugins = plugins . map ( ( p ) => injectEnvironmentToHooks ( this as any , p ) )
191
197
Original file line number Diff line number Diff line change @@ -4,6 +4,8 @@ import virtualTest from 'virtual:test'
4
4
// @ts -expect-error no type
5
5
import testAlias from 'test-alias'
6
6
import { throwError } from './error'
7
+ import './test-style.css'
8
+ import testStyleInline from './test-style-inline.css?inline'
7
9
8
10
export function App ( ) {
9
11
const [ count , setCount ] = React . useState ( 0 )
@@ -17,8 +19,16 @@ export function App() {
17
19
</ button >
18
20
< pre > [virtual] { virtualTest } </ pre >
19
21
< 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 */ }
21
23
< 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 >
22
32
</ div >
23
33
</ div >
24
34
)
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