如何让我们的node代码支持esModule

123 阅读1分钟
  • 现在的node版本已经支持了
  • 只需要在package.json中加入type字段, 值就是'module', 这样我们的node环境的代码, 就能用import字段来支持了