File tree 1 file changed +8
-4
lines changed
1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,12 @@ import { preactDevtoolsPlugin } from "./devtools.js";
8
8
import { createFilter , parseId } from "./utils.js" ;
9
9
import { vitePrerenderPlugin } from "vite-prerender-plugin" ;
10
10
import { transformAsync } from "@babel/core" ;
11
+ // @ts -ignore package doesn't ship with declaration files
12
+ import babelReactJsx from "@babel/plugin-transform-react-jsx" ;
13
+ // @ts -ignore package doesn't ship with declaration files
14
+ import babelReactJsxDev from "@babel/plugin-transform-react-jsx-development" ;
15
+ // @ts -ignore package doesn't ship with declaration files
16
+ import babelHookNames from "babel-plugin-transform-hook-names" ;
11
17
12
18
export type BabelOptions = Omit <
13
19
TransformOptions ,
@@ -234,15 +240,13 @@ function preactPlugin({
234
240
plugins : [
235
241
...babelOptions . plugins ,
236
242
[
237
- config . isProduction
238
- ? "@babel/plugin-transform-react-jsx"
239
- : "@babel/plugin-transform-react-jsx-development" ,
243
+ config . isProduction ? babelReactJsx : babelReactJsxDev ,
240
244
{
241
245
runtime : "automatic" ,
242
246
importSource : jsxImportSource ?? "preact" ,
243
247
} ,
244
248
] ,
245
- ...( devToolsEnabled ? [ "babel-plugin-transform-hook-names" ] : [ ] ) ,
249
+ ...( devToolsEnabled ? [ babelHookNames ] : [ ] ) ,
246
250
] ,
247
251
sourceMaps : true ,
248
252
inputSourceMap : false as any ,
You can’t perform that action at this time.
0 commit comments