Skip to content

Commit

Permalink
fix(config): set correct module format for TypeScript
Browse files Browse the repository at this point in the history
When having a root tsconfig which is used by the application with module value other than `commonjs` it would fail if you have an `import` statement with an error `SyntaxError: Unexpected token` This is due that under node module target should be set for `commonjs`
  • Loading branch information
Alan Agius committed Sep 18, 2018
1 parent d65e911 commit 5394a65
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ try {
} catch (e) {}

try {
require('ts-node').register()
require('ts-node').register({ compilerOptions: { module: 'commonjs' } })
TYPE_SCRIPT_AVAILABLE = true
} catch (e) {}

Expand Down

0 comments on commit 5394a65

Please sign in to comment.