最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Using babel-standalone in the browser - Stack Overflow

programmeradmin0浏览0评论

I am using babel-standalone and I am doing the exact same thing as .htm, but I get the warning

You are using the in-browser Babel transformer. Be sure to precompile your scripts for production - /

I don't know what to do. Shouldn't it just translate all my ES6 code to code supported by older browsers?

I am using babel-standalone and I am doing the exact same thing as https://github.com/Daniel15/babel-standalone/blob/master/examples/scriptTag-src.htm, but I get the warning

You are using the in-browser Babel transformer. Be sure to precompile your scripts for production - https://babeljs.io/docs/setup/

I don't know what to do. Shouldn't it just translate all my ES6 code to code supported by older browsers?

Share Improve this question asked Oct 11, 2016 at 18:27 JamgreenJamgreen 11k32 gold badges121 silver badges231 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 19

It's just a warning, nothing to worry about.

It's just telling you that you shouldn't run Babel in the browser on production sites, because running Babel in the browser is slower than precompiling your files with Babel, because the browser will have to compile your files every time you open a page. But if you're running it for development or personal pages, or if you just don't care (e.g., you don't have that much code), you won't need to worry about this warning.

发布评论

评论列表(0)

  1. 暂无评论