【发布时间】:2016-12-18 18:22:14
【问题描述】:
http://kangax.github.io/compat-table/es6/ 的 ES6 Kangax 兼容性表显示了“TypeScript + core-js”的结果。我需要 core-js 才能使用像 String#startsWith 这样的 ES6 方法。我无法弄清楚如何告诉 TypeScript 编译器考虑 core-js 并且找不到示例。如何在 TypeScript 中使用 core-js?
【问题讨论】:
-
你不能使用打字稿中的标准 ES6 定义吗? github.com/Microsoft/TypeScript/blob/master/bin/lib.es6.d.ts 或者您的意思是如何加载库?
-
啊,是的,我可以使用它!谢谢!
标签: javascript ecmascript-6 typescript1.5