Why does babel-node not support module loading in the REPL?

删除回忆录丶 提交于 2019-12-07 16:21:25

问题


It's established that babel-node doesn't support module loading in the REPL. In the documentation it simply says this:

Due to technical limitations ES6-style module-loading is not fully supported in a babel-node REPL.

My question is why? If I wrote a tiny script named t.js and ran it with babel-node, then import statements would work fine. What is the effective difference between a REPL which reads source code a line at a time from standard in, and babel-node t.js which reads source code from a file?

Does anyone know if there are plans to support import in the future, as lack of import kinda kills the REPL?

来源:https://stackoverflow.com/questions/39064755/why-does-babel-node-not-support-module-loading-in-the-repl

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!