Babel 6 CLI: Unexpected token export?

前端 未结 2 1479
失恋的感觉
失恋的感觉 2020-12-25 09:30

I\'m trying to run Babel through it\'s CLI using babel-node but I keep getting the Unexpected token export error. I understand that Babel 6 is all

2条回答
  •  再見小時候
    2020-12-25 10:06

    I received the same error, but my webpack/babel configs looked correct. By trial and error, I replaced export myFunction with export default myFunction and the error got resolved.


    Later, I realized that the correct way of exporting is export {myFunction}. I implemented it and everything works fine.

提交回复
热议问题