Skip to content

Commit cdef314

Browse files
committed
fix: Strips jsxFactory from tsconfig if --imporSource is set
1 parent fd4ea1a commit cdef314

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/index.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ export default async function microbundle(inputOptions) {
7171
options.pkg.name = pkgName;
7272

7373
if (options.sourcemap === 'inline') {
74+
// eslint-disable-next-line no-console
7475
console.log(
7576
'Warning: inline sourcemaps should only be used for debugging purposes.',
7677
);
@@ -550,8 +551,10 @@ function createConfig(options, entry, format, writeMeta) {
550551
declarationDir: getDeclarationDir({ options, pkg }),
551552
}),
552553
jsx: 'preserve',
553-
jsxFactory: options.jsx,
554-
jsxFragmentFactory: options.jsxFragment,
554+
...(!options.jsxImportSource && {
555+
jsxFactory: options.jsx,
556+
jsxFragmentFactory: options.jsxFragment,
557+
}),
555558
},
556559
files: options.entries,
557560
},
@@ -642,6 +645,7 @@ function createConfig(options, entry, format, writeMeta) {
642645
options.visualize && visualizer(),
643646
// NOTE: OMT only works with amd and esm
644647
// Source: https://github.com/surma/rollup-plugin-off-main-thread#config
648+
// eslint-disable-next-line new-cap
645649
useWorkerLoader && (format === 'es' || modern) && OMT(),
646650
/** @type {import('rollup').Plugin} */
647651
({

0 commit comments

Comments
 (0)