Skip to content

Commit e5dcbfc

Browse files
authored
Merge pull request #6 from Songkeys/feat-support-importSouce
2 parents 43b00ee + 742bc9c commit e5dcbfc

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

package-lock.json

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "tsconfig-to-swcconfig",
3-
"version": "1.4.0",
3+
"version": "1.5.0",
44
"description": "Convert tsconfig to swc config",
55
"main": "dist/index.js",
66
"scripts": {

src/index.ts

+3
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ export function convertTsConfig(
3030
module: _module,
3131
jsxFactory = 'React.createElement',
3232
jsxFragmentFactory = 'React.Fragment',
33+
jsxImportSource = 'react',
3334
strict = false,
3435
alwaysStrict = false,
3536
noImplicitUseStrict = false,
@@ -52,6 +53,7 @@ export function convertTsConfig(
5253
target: target as swcType.JscTarget,
5354
parser: {
5455
syntax: 'typescript',
56+
tsx: true,
5557
decorators: experimentalDecorators,
5658
dynamicImport: true,
5759
},
@@ -64,6 +66,7 @@ export function convertTsConfig(
6466
useBuiltins: false,
6567
pragma: jsxFactory,
6668
pragmaFrag: jsxFragmentFactory,
69+
importSource: jsxImportSource,
6770
},
6871
},
6972
keepClassNames: !['es3', 'es5', 'es6', 'es2015'].includes(

0 commit comments

Comments
 (0)