Got a situation here.
I use nodejs with --harmony
flag to get support of generators.
Next i'm trying to switch my project to TypeScript and get a problem: in "target":"ES6"
mode it transpiles import
commands as is (instead of require
).
And node with --harmony
flag doesn't support that:
import * as fs from 'fs';
^^^^^^
SyntaxError: Unexpected reserved word
Transpiling option "module":"commonjs
isn't allowed with "target":"ES6"
.
Have anyone solved this problem without using any external require/import utilities?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…