Skip to content

Commit

Permalink
Fix syntax support
Browse files Browse the repository at this point in the history
  • Loading branch information
lxsmnsyc committed Feb 3, 2024
1 parent d025f6d commit 0cdac56
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import { createRequire } from 'module';
import solidRefresh from 'solid-refresh/babel';
// TODO use proper path
import type { Options as RefreshOptions } from 'solid-refresh/babel';
import type { Alias, AliasOptions, FilterPattern, Plugin } from 'vite';
import { createFilter } from 'vite';
import type { Alias, AliasOptions, Plugin, FilterPattern } from 'vite';
import { crawlFrameworkPkgs } from 'vitefu';

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

return extensionOptions.typescript;
});
const plugins: NonNullable<NonNullable<babel.TransformOptions['parserOpts']>['plugins']> = ['jsx']
const plugins: NonNullable<NonNullable<babel.TransformOptions['parserOpts']>['plugins']> = [
'jsx',
// import { example } from 'example' with { example: true };
'importAttributes',
// () => throw example
'throwExpressions',
// You know what this is
'decorators',
// const { #example: example } = this;
'destructuringPrivate',
// using example = myExample()
'explicitResourceManagement',
];

if (shouldBeProcessedWithTypescript) {
plugins.push('typescript');
Expand Down

0 comments on commit 0cdac56

Please sign in to comment.