javascript - installed babel, doesn't work
阿神
阿神 2017-06-27 09:19:25
0
1
1070

I wanted to use the import of es6, but the browser reported an error index.js:1 Uncaught SyntaxError: Unexpected token import. Later, I checked on the Internet and said that babel was missing. Then I installed babel according to Ruan Yifeng's tutorial, but ran the code. Still reporting the same error

This is the entire directory structure

This is html
This is index.js

This is show.js

This is the configuration file
Which master can help me take a look

阿神
阿神

闭关修行中......

reply all(1)
typecho

http://babeljs.cn/docs/setup/...

Execute to get the compiled js. Babel is usually used with automated tools. Manual compilation can be used when learning, and later used with gulp or webpack

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template