Skip to content

Commit

Permalink
Fix ts-node config to support tsx files
Browse files Browse the repository at this point in the history
  • Loading branch information
cody authored and cody committed Jan 7, 2020
1 parent 4cac6ce commit 515da04
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/ttypescript/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"ttsc": "./bin/tsc",
"ttsserver": "./bin/tsserver"
},
"version": "1.5.8",
"version": "1.5.9",
"description": "Over TypeScript tool to use custom transformers in the tsconfig.json",
"main": "lib/typescript.js",
"files": [
Expand Down
5 changes: 3 additions & 2 deletions packages/ttypescript/src/PluginCreator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ export class PluginCreator {
private resolveFactory(transform: string, importKey: string = 'default'): PluginFactory | undefined {
if (
!tsNodeIncluded &&
transform.match(/\.ts$/) &&
transform.match(/\.tsx?$/) &&
(module.parent!.parent === null ||
module.parent!.parent!.parent === null ||
module.parent!.parent!.parent!.id.split(/[\/\\]/).indexOf('ts-node') === -1)
Expand All @@ -210,7 +210,8 @@ export class PluginCreator {
transpileOnly: true,
skipProject: true,
compilerOptions: {
target: 'es5',
target: 'es6',
jsx: 'react',
module: 'commonjs',
},
});
Expand Down

0 comments on commit 515da04

Please sign in to comment.