问题
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