File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed
Expand file tree Collapse file tree 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";
88import { createFilter , parseId } from "./utils.js" ;
99import { vitePrerenderPlugin } from "vite-prerender-plugin" ;
1010import { 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" ;
1117
1218export type BabelOptions = Omit <
1319 TransformOptions ,
@@ -234,15 +240,13 @@ function preactPlugin({
234240 plugins : [
235241 ...babelOptions . plugins ,
236242 [
237- config . isProduction
238- ? "@babel/plugin-transform-react-jsx"
239- : "@babel/plugin-transform-react-jsx-development" ,
243+ config . isProduction ? babelReactJsx : babelReactJsxDev ,
240244 {
241245 runtime : "automatic" ,
242246 importSource : jsxImportSource ?? "preact" ,
243247 } ,
244248 ] ,
245- ...( devToolsEnabled ? [ "babel-plugin-transform-hook-names" ] : [ ] ) ,
249+ ...( devToolsEnabled ? [ babelHookNames ] : [ ] ) ,
246250 ] ,
247251 sourceMaps : true ,
248252 inputSourceMap : false as any ,
You can’t perform that action at this time.
0 commit comments