简体   繁体   中英

unexpected token import (webpack es6)

i am trying to bundle es6 modules with webpack. I have done everything written here http://www.zsoltnagy.eu/using-es6-modules-with-webpack/ but error still exist. How can i fix this?

It's pretty old article, the babel has been updated from that time, so you have to

  • create file .babelrc
  • add presets to support necessary features

Full list of necessary information can be found in the official docs: https://babeljs.io/blog/2015/10/31/setting-up-babel-6

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM