Skip to content

Commit 0cdac56

Browse files
committed
Fix syntax support
1 parent d025f6d commit 0cdac56

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

src/index.ts

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ import { createRequire } from 'module';
66
import solidRefresh from 'solid-refresh/babel';
77
// TODO use proper path
88
import type { Options as RefreshOptions } from 'solid-refresh/babel';
9+
import type { Alias, AliasOptions, FilterPattern, Plugin } from 'vite';
910
import { createFilter } from 'vite';
10-
import type { Alias, AliasOptions, Plugin, FilterPattern } from 'vite';
1111
import { crawlFrameworkPkgs } from 'vitefu';
1212

1313
const require = createRequire(import.meta.url);
@@ -312,7 +312,19 @@ export default function solidPlugin(options: Partial<Options> = {}): Plugin {
312312

313313
return extensionOptions.typescript;
314314
});
315-
const plugins: NonNullable<NonNullable<babel.TransformOptions['parserOpts']>['plugins']> = ['jsx']
315+
const plugins: NonNullable<NonNullable<babel.TransformOptions['parserOpts']>['plugins']> = [
316+
'jsx',
317+
// import { example } from 'example' with { example: true };
318+
'importAttributes',
319+
// () => throw example
320+
'throwExpressions',
321+
// You know what this is
322+
'decorators',
323+
// const { #example: example } = this;
324+
'destructuringPrivate',
325+
// using example = myExample()
326+
'explicitResourceManagement',
327+
];
316328

317329
if (shouldBeProcessedWithTypescript) {
318330
plugins.push('typescript');

0 commit comments

Comments
 (0)