From 0518375485974258461910b78e73b49ef5b4f67b Mon Sep 17 00:00:00 2001 From: LongYinan Date: Sun, 9 Aug 2020 21:17:21 +0800 Subject: [PATCH] fix(core): missing jsx option --- packages/core/index.d.ts | 1 + packages/core/index.js | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/core/index.d.ts b/packages/core/index.d.ts index b06cf192c..94feaef8c 100644 --- a/packages/core/index.d.ts +++ b/packages/core/index.d.ts @@ -2,6 +2,7 @@ export interface Options { target?: 'es3' | 'es5' | 'es2015' | 'es2016' | 'es2017' | 'es2018' | 'es2019' | 'es2020' module?: 'commonjs' | 'umd' | 'amd' | 'es6' sourcemap?: boolean | 'inline' + jsx?: boolean experimentalDecorators?: boolean emitDecoratorMetadata?: boolean dynamicImport?: boolean diff --git a/packages/core/index.js b/packages/core/index.js index c03292b7d..e5f3dc75c 100644 --- a/packages/core/index.js +++ b/packages/core/index.js @@ -23,7 +23,7 @@ module.exports = { target: 'es2018', parser: { syntax: 'typescript', - tsx: path.endsWith('.tsx'), + tsx: typeof opts.jsx !== 'undefined' ? opts.jsx : path.endsWith('.tsx'), decorators: Boolean(opts.experimentalDecorators), dynamicImport: Boolean(opts.dynamicImport), }, @@ -48,7 +48,7 @@ module.exports = { target: 'es2018', parser: { syntax: 'typescript', - tsx: path.endsWith('.tsx'), + tsx: typeof opts.jsx !== 'undefined' ? opts.jsx : path.endsWith('.tsx'), decorators: Boolean(opts.experimentalDecorators), dynamicImport: Boolean(opts.dynamicImport), },