如何使用 TypeScript 以 ES6 为目标以获得 ionic2 的 Async/Await 支持?
How do I target ES6 using TypeScript to get Async/Await support with ionic2?
使用默认的 ionic2 项目我将 tsconfig.json 更新为目标 "es6" 并立即开始出现以下错误:
TypeScript error: c:/test/node_modules/typescript/lib/lib.es6.d.ts(17,14): Error TS2300: Duplicate identifier 'PropertyKey'.
TypeScript error: typings/globals/es6-shim/index.d.ts(3,14): Error TS2300: Duplicate identifier 'PropertyKey'.
如何正确定位 es6 以避免这些构建错误?
如果你的目标是 es6,你将不需要 es6-shim,如果我没记错的话。从 typings.json 中删除它,删除 typings 文件夹并重新安装。那应该处理重复的标识符。
使用默认的 ionic2 项目我将 tsconfig.json 更新为目标 "es6" 并立即开始出现以下错误:
TypeScript error: c:/test/node_modules/typescript/lib/lib.es6.d.ts(17,14): Error TS2300: Duplicate identifier 'PropertyKey'.
TypeScript error: typings/globals/es6-shim/index.d.ts(3,14): Error TS2300: Duplicate identifier 'PropertyKey'.
如何正确定位 es6 以避免这些构建错误?
如果你的目标是 es6,你将不需要 es6-shim,如果我没记错的话。从 typings.json 中删除它,删除 typings 文件夹并重新安装。那应该处理重复的标识符。