There is a situation here. I am using nodejs with the --harmony flag to get generator support. Then I try to switch my project to TypeScript and get the problem: in the "target":"ES6" it translates the import commands as they are (instead of require ).
And node with the --harmony flag --harmony not support this:
import * as fs from 'fs'; ^^^^^^ SyntaxError: Unexpected reserved word
The overflow option "module":"commonjs not allowed with "target":"ES6" .
Has anyone solved this problem without using any external require / import utilities?
source share