Skip to content

Commit 556b1b8

Browse files
Merge pull request #2724 from thenbe/add-vite-option
docs(vitest): explicitly specify swcrc option to avoid conflict with vite
2 parents acd6b97 + ed5206d commit 556b1b8

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

content/recipes/swc.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,13 @@ export default defineConfig({
121121
globals: true,
122122
root: './',
123123
},
124-
plugins: [swc.vite()], // This is required to build the test files with SWC
124+
plugins: [
125+
// This is required to build the test files with SWC
126+
swc.vite({
127+
// Explicitly set the module type to avoid inheriting this value from a `.swcrc` config file
128+
module: { type: 'es6' },
129+
}),
130+
],
125131
});
126132
```
127133

0 commit comments

Comments
 (0)