How to install babel and using ES6 locally on Browser?

后端 未结 5 1126
猫巷女王i
猫巷女王i 2021-02-04 03:06

So, I am following tutorial to learn ES2015 on here:

http://k33g.github.io/2015/05/02/ES6.html

But, I don\'t find this file based on that tutorial:

<         


        
5条回答
  •  终归单人心
    2021-02-04 04:03

    In-browser transpiling has been removed from Babel 6, however Daniel15 has created a standalone build for use in "non-Node.js environments including browsers" here:

    https://github.com/Daniel15/babel-standalone

    All you need to do is add this reference to your page:

    And then make sure you're using the script type="text/babel" attribute in your references to other script files.

    UPDATE: More info can now be found here: babeljs.io/docs/en/next/babel-standalone.html

提交回复
热议问题