Skip to content

Commit db028c3

Browse files
committed
allow plugin to work in rolldown
rolldown does not expose importedIdResolutions similar to rollup and so we need to manually get it from importedIds and this.getModuleInfo
1 parent 7d1c4d8 commit db028c3

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

.changeset/light-guests-pull.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@vanilla-extract/rollup-plugin': patch
3+
---
4+
5+
allow plugin to work in rolldown

packages/rollup-plugin/src/index.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,9 @@ export function vanillaExtractPlugin({
7474
},
7575
// Emit .css assets
7676
moduleParsed(moduleInfo) {
77-
moduleInfo.importedIdResolutions.forEach((resolution) => {
78-
if (resolution.meta.css) {
77+
moduleInfo.importedIds.forEach((id) => {
78+
const resolution = this.getModuleInfo(id);
79+
if (resolution?.meta.css) {
7980
resolution.meta.assetId = this.emitFile({
8081
type: 'asset',
8182
name: resolution.id,

0 commit comments

Comments
 (0)