Skip to content

Commit 508bc73

Browse files
committed
Merge branch 'ylc395-fix/vite-babel'
2 parents 6390800 + 05163c3 commit 508bc73

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

.changeset/huge-suns-change.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"solid-devtools": patch
3+
---
4+
5+
fix: babel plugin resolution by importing @babel/plugin-syntax-typescript instead of passing it as a string

packages/main/src/vite/vite.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ import * as path from 'node:path'
22
import * as vite from 'vite'
33
import {type PluginItem, transformAsync} from '@babel/core'
44
import * as debug from '@solid-devtools/debugger/types'
5+
// @ts-expect-error
6+
import plugin_ts_syntax from '@babel/plugin-syntax-typescript'
57
import * as babel from '../babel.ts'
68

79
export const enum DevtoolsModule {
@@ -116,7 +118,7 @@ export const devtoolsPlugin = (_options: DevtoolsPluginOptions = {}): vite.Plugi
116118
}
117119

118120
// babel doesn't work with typescript by default
119-
plugins.unshift(['@babel/plugin-syntax-typescript', {isTSX: is_jsx}])
121+
plugins.unshift([plugin_ts_syntax, {isTSX: is_jsx}])
120122

121123
const result = await transformAsync(source, {
122124
babelrc: false,

0 commit comments

Comments
 (0)