Skip to content

Commit a34b23c

Browse files
committed
fix(macros): prevent handle dts files
1 parent 8a349d1 commit a34b23c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

packages/macros/src/core/index.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,9 @@ export function transformJsxMacros(
5353
options: OptionsResolved,
5454
): CodeTransform | undefined {
5555
const s = new MagicStringAST(code)
56-
const ast = babelParse(s.original, getLang(id))
56+
const lang = getLang(id)
57+
if (lang === 'dts') return
58+
const ast = babelParse(s.original, lang)
5759
const rootMap = getRootMap(ast, s, options)
5860

5961
let defineStyleIndex = 0

0 commit comments

Comments
 (0)