描述項(xiàng)目中有2個文件夾,分別為star和lottery,里面都有index.ts,兩個ts文件都有一個名為Hello的類,按理說不同文件有相同類聲明應(yīng)該沒問題,可是為什么會報(bào)[ts] Duplicate identifier 'Hello'這個錯啊,把其中一個Class名改了,就沒問題了tsconfig配置文件如下{ "compilerOptions": { "target": "es5", "module": "commonjs", "sourceMap": false, "outDir": "build" }, "exclude": [ "node_modules", "typings/main", "typings/main.d.ts", "tsd/phaser.comments.d.ts", "tsd/pixi.comments.d.ts" ]}
Typescript多文件同一class名稱報(bào)錯
至尊寶的傳說
2018-11-29 23:15:12