diff --git a/src/index.ts b/src/index.ts index 8b1080e..54cc958 100644 --- a/src/index.ts +++ b/src/index.ts @@ -57,6 +57,10 @@ export interface PreactPluginOptions { * Babel configuration applied in both dev and prod. */ babel?: BabelOptions; + /** + * Import Source for jsx. Defaults to "preact". + */ + jsxImportSource?: string; } export interface PreactBabelOptions extends BabelOptions { @@ -77,6 +81,7 @@ function preactPlugin({ include, exclude, babel, + jsxImportSource, }: PreactPluginOptions = {}): Plugin[] { const baseParserOptions = [ "importMeta", @@ -157,7 +162,7 @@ function preactPlugin({ : "@babel/plugin-transform-react-jsx-development", { runtime: "automatic", - importSource: "preact", + importSource: jsxImportSource ?? "preact", }, ], ...(config.isProduction ? [] : ["babel-plugin-transform-hook-names"]),