Skip to content

Commit ebb3edc

Browse files
authored
Trigger rebuild for CSS file dependencies (#16)
1 parent 2c46c8b commit ebb3edc

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

.changeset/serious-geese-run.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@vanilla-extract/esbuild-plugin': patch
3+
---
4+
5+
Trigger rebuild for CSS file dependencies

packages/esbuild-plugin/src/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ export function vanillaExtractPlugin({
104104
plugins: [vanillaExtractFilescopePlugin({ projectRoot })],
105105
});
106106

107-
const { outputFiles } = result;
107+
const { outputFiles, metafile } = result;
108108

109109
if (!outputFiles || outputFiles.length !== 1) {
110110
throw new Error('Invalid child compilation');
@@ -158,6 +158,7 @@ export function vanillaExtractPlugin({
158158
return {
159159
contents,
160160
loader: 'js',
161+
watchFiles: Object.keys(metafile?.inputs || {}),
161162
};
162163
});
163164
},

0 commit comments

Comments
 (0)