Skip to content

Commit 58613c3

Browse files
committed
feat: add transformInclude
1 parent b2baf10 commit 58613c3

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

src/core/index.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export * from "./context"
2-
export * from "./directive"
3-
export * from "./directives"
4-
export * from "./unplugin"
1+
export * from './context'
2+
export * from './directive'
3+
export * from './directives'
4+
export * from './unplugin'

src/core/unplugin.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ export const unpluginFactory: UnpluginFactory<UserOptions | undefined> = (
1111
name: 'unplugin-preprocessor-directives',
1212
enforce: 'pre',
1313
transform: (code, id) => ctx.transform(code, id),
14+
transformInclude(id) {
15+
return ctx.filter(id)
16+
},
1417
vite: {
1518
configResolved(config) {
1619
ctx.env = { ...ctx.env, ...config.env }

0 commit comments

Comments
 (0)