Skip to content

Commit 0cfd17d

Browse files
authored
Compile .css.ts files with ts loader (#68)
1 parent 80341cb commit 0cfd17d

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

.changeset/sweet-turkeys-rhyme.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+
Fix errors occurring when using TypeScript in .css.ts files

fixtures/themed/src/shared.css.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { globalStyle, style } from '@vanilla-extract/css';
22

3-
export const shadow = style({
3+
export const shadow: string = style({
44
boxShadow: '0 0 5px red',
55
});
66

packages/esbuild-plugin/src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ const vanillaExtractFilescopePlugin = (): Plugin => ({
5353

5454
return {
5555
contents,
56+
loader: path.match(/\.(ts|tsx)$/i) ? 'ts' : undefined,
5657
resolveDir: dirname(path),
5758
};
5859
}

0 commit comments

Comments
 (0)