File tree Expand file tree Collapse file tree 2 files changed +13
-15
lines changed
packages/rollup-plugin/src Expand file tree Collapse file tree 2 files changed +13
-15
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ ' @vanilla-extract/rollup-plugin ' : patch
3
+ ---
4
+
5
+ allow plugin to work in rolldown
Original file line number Diff line number Diff line change @@ -72,27 +72,20 @@ export function vanillaExtractPlugin({
72
72
} ,
73
73
} ;
74
74
} ,
75
- // Emit .css assets
76
- moduleParsed ( moduleInfo ) {
77
- moduleInfo . importedIdResolutions . forEach ( ( resolution ) => {
78
- if ( resolution . meta . css ) {
79
- resolution . meta . assetId = this . emitFile ( {
80
- type : 'asset' ,
81
- name : resolution . id ,
82
- source : resolution . meta . css ,
83
- } ) ;
84
- }
85
- } ) ;
86
- } ,
87
- // Replace .css import paths with relative paths to emitted css files
75
+ // Emit .css assets and replace .css import paths with relative paths to emitted css files
88
76
renderChunk ( code , chunkInfo ) {
89
77
const chunkPath = dirname ( chunkInfo . fileName ) ;
90
78
const output = chunkInfo . imports . reduce ( ( codeResult , importPath ) => {
91
79
const moduleInfo = this . getModuleInfo ( importPath ) ;
92
- if ( ! moduleInfo ?. meta . assetId ) {
80
+ if ( ! moduleInfo ?. meta . css ) {
93
81
return codeResult ;
94
82
}
95
- const assetPath = this . getFileName ( moduleInfo ?. meta . assetId ) ;
83
+ const assetId = this . emitFile ( {
84
+ type : 'asset' ,
85
+ name : moduleInfo . id ,
86
+ source : moduleInfo . meta . css ,
87
+ } ) ;
88
+ const assetPath = this . getFileName ( assetId ) ;
96
89
const relativeAssetPath = `./${ normalize (
97
90
relative ( chunkPath , assetPath ) ,
98
91
) } `;
You can’t perform that action at this time.
0 commit comments