Skip to content

Commit b04fee7

Browse files
committed
fix: apply filter for css-post plugin and json plugin
this was not working because of vitejs#19586 (comment) and vitejs#19878
1 parent 9ff0d57 commit b04fee7

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

packages/vite/src/node/plugins/css.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1095,8 +1095,10 @@ export function cssPostPlugin(config: ResolvedConfig): Plugin {
10951095

10961096
// backward compat
10971097
const handler = plugin.transform.handler
1098+
const filter = plugin.transform.filter
10981099
;(plugin as any).transform = handler
10991100
;(plugin as any).transform.handler = handler
1101+
;(plugin as any).transform.filter = filter
11001102

11011103
return plugin
11021104
}

packages/vite/src/node/plugins/json.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,10 @@ export function jsonPlugin(
129129

130130
// backward compat
131131
const handler = plugin.transform.handler
132+
const filter = plugin.transform.filter
132133
;(plugin as any).transform = handler
133134
;(plugin as any).transform.handler = handler
135+
;(plugin as any).transform.filter = filter
134136

135137
return plugin
136138
}

0 commit comments

Comments
 (0)