有没有一种已知的工作方法可以逃避Node.js本机ES模块的相对路径?

时间:2020-10-16 21:43:06

标签: node.js es6-modules

当前是否存在一种已知的工作方法,可以使用本机ES模块来逃避Node.js中的相对导入路径地狱,而无需使用转译器/打包器?

  • import foo from "<some-constant-prefix-that-I-can-use-everywhere>/foo";必须正常工作
  • 具有纯净的node index.js,没有编译器
  • node --some-esoteric-options index.js作为最后的选择也许可以接受

0 个答案:

没有答案