Skip to content

Commit e5f663f

Browse files
committed
chore: apply only on dev mode
1 parent 8ff9775 commit e5f663f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/index.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,10 @@ function VitePluginInspector(options: VitePluginInspectorOptions = { vue: 3, ena
1515
return {
1616
name: "vite-plugin-vue-inspector",
1717
enforce: "pre",
18-
apply: "serve",
18+
apply(_, { command }) {
19+
// apply only on serve and not for test
20+
return command === "serve" && process.env.NODE_ENV !== "test"
21+
},
1922
transform(code, id) {
2023
const { filename, query } = parseVueRequest(id)
2124

0 commit comments

Comments
 (0)