简体   繁体   English

如果我使用TypeScript创建ES5脚本,我的HTML中是否需要traceur脚本标签?

[英]If I use TypeScript to create ES5 script, do I need a traceur script tag in my html?

I am using TypeScript 1.5 to generate ES5 script for a simple angular2 app. 我正在使用TypeScript 1.5为简单的angular2应用生成ES5脚本。

Will I need to include both a script element referencing a module loader (such as SystemJS) AND a script element referencing traceur (such as the one below) in my index.html file? 我是否需要在index.html文件中同时包含引用模块加载程序的脚本元素(例如SystemJS)和引用traceur的脚本元素(例如下面的脚本)?

<script src="https://github.jspm.io/jmcriffey/bower-traceur-runtime@0.0.91/traceur-runtime.js"></script>
script src="https://jspm.io/system@0.16.js"></script>

...Or do I only need the script element for SystemJS? ...或者我只需要SystemJS的script元素?

No, as far as I know traceur still is a dependency of angular2. 不,据我所知traceur仍然是angular2的依赖项。 There's an issue to remove it though, therefore in the future it'll be possible. 不过,存在删除它的问题,因此将来有可能。 Here you can find the issue for it if you want to track the progress. 如果要跟踪进度, 可以在这里找到问题所在。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 我应该使用Traceur而不是Typescript来定位ES5,但是要为ES6做好准备 - Should I use Traceur instead of Typescript to target ES5 but be ready for ES6 定位es5时如何将Promises与TypeScript一起使用? - How do I use Promises with TypeScript when targeting es5? 我可以在angular 2.0上使用Typescript,还是应该使用Traceur? - Will I be able to use Typescript with angular 2.0, or should I use Traceur? 如何将包装所有方法的 TypeScript ES5 类装饰器升级到 ES2015/ES6? - How do I upgrade a TypeScript ES5 Class decorator that wraps all methods to ES2015/ES6? 如何将 TypeScript 用于通过脚本标记加载的 JavaScript? - How can I use TypeScript for JavaScript loaded via script tag? 如何从我的打字稿项目的脚本创建 dist/app.js - How do I create dist/app.js from script for my typescript project 我可以用 in 写打字稿吗<Script> tag? - Can i write typescript with in <Script> tag? TypeScript在Bluebird的ES5中使用动态导入 - TypeScript use dynamic import in ES5 with Bluebird 在面向 ES5 的 TypeScript 中使用 async / await - Use async / await in TypeScript targeting ES5 打字稿是否需要编译为es6,然后编译为es5 - Does typescript need to be compiled to es6 and then to es5
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM