Skip to content

Commit c02c6a2

Browse files
committed
fix HEREs being off in vitest
1 parent 591fafe commit c02c6a2

File tree

3 files changed

+16
-1
lines changed

3 files changed

+16
-1
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@
9595
},
9696
"devDependencies": {
9797
"@antfu/eslint-config": "^4.1.1",
98+
"@babel/plugin-syntax-typescript": "^7.25.9",
9899
"@paralleldrive/cuid2": "^2.2.2",
99100
"@samual/rollup-config": "0.1.3-858c2de",
100101
"@total-typescript/ts-reset": "^0.6.1",

pnpm-lock.yaml

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vitest.config.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,19 @@
11
import type { ViteUserConfig } from "vitest/config"
2+
// @ts-expect-error it does exist, it just doesn't have typings
3+
import babelPluginSyntaxTypescript from "@babel/plugin-syntax-typescript"
24
import { babel } from "@rollup/plugin-babel"
35
import { babelPluginHere } from "babel-plugin-here"
46

57
export default {
68
test: { includeSource: [ `src/**/*.ts` ] },
7-
plugins: [ babel({ babelHelpers: `bundled`, extensions: [ `.ts` ], plugins: [ babelPluginHere() ] }) as any ]
9+
plugins: [
10+
{
11+
...babel({
12+
babelHelpers: `bundled`,
13+
extensions: [ `.ts` ],
14+
plugins: [ babelPluginSyntaxTypescript, babelPluginHere() ]
15+
}) as any,
16+
enforce: `pre`
17+
}
18+
]
819
} satisfies ViteUserConfig

0 commit comments

Comments
 (0)