Skip to content

Commit 2cad138

Browse files
Add Vite 5 to peer dependencies (#1240)
Co-authored-by: Mark Dalgleish <[email protected]>
1 parent 1791df2 commit 2cad138

File tree

4 files changed

+9
-8
lines changed

4 files changed

+9
-8
lines changed

.changeset/selfish-jeans-mate.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@vanilla-extract/vite-plugin': patch
3+
---
4+
5+
Add Vite 5 to peer dependencies

packages/vite-plugin/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,6 @@
2424
"vite": "npm:vite@^2.7.0"
2525
},
2626
"peerDependencies": {
27-
"vite": "^2.2.3 || ^3.0.0 || ^4.0.3"
27+
"vite": "^2.2.3 || ^3.0.0 || ^4.0.3 || ^5.0.0"
2828
}
2929
}

packages/vite-plugin/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import {
1212
CompileOptions,
1313
transform,
1414
} from '@vanilla-extract/integration';
15-
import { PostCSSConfigResult, resolvePostcssConfig } from './postcss';
15+
import { type PostCSSConfigResult, resolvePostcssConfig } from './postcss';
1616

1717
const styleUpdateEvent = (fileId: string) =>
1818
`vanilla-extract-style-update:${fileId}`;

packages/vite-plugin/src/postcss.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
1+
import type postcssrc from 'postcss-load-config';
12
import type { ResolvedConfig } from 'vite';
2-
import type { ProcessOptions, Plugin } from 'postcss';
33

4-
export interface PostCSSConfigResult {
5-
options: ProcessOptions;
6-
plugins: Plugin[];
7-
}
4+
export type PostCSSConfigResult = Pick<postcssrc.Result, 'options' | 'plugins'>;
85

96
// Mostly copied from vite's implementation
107
// https://github.com/vitejs/vite/blob/efec70f816b80e55b64255b32a5f120e1cf4e4be/packages/vite/src/node/plugins/css.ts
@@ -34,7 +31,6 @@ export const resolvePostcssConfig = async (
3431

3532
return {
3633
options: postCssConfig.options,
37-
// @ts-expect-error - The postcssrc options don't agree with real postcss, but it should be ok
3834
plugins: postCssConfig.plugins,
3935
};
4036
} catch (e: any) {

0 commit comments

Comments
 (0)