【发布时间】:2020-12-26 15:35:17
【问题描述】:
我遇到了有关如何使用 Babel 在 Node.js 中使用 ES6 导入的教程,但是 CommonJS 导入不起作用。我想在 Node.js (Express.js) 中使用 ES6 导入和 CommonJS 导入在同一文件中。
main.js
const jsdom = require("jsdom");
import {GotRequestFunction} from 'got';
这可能吗?
【问题讨论】:
标签: node.js express babeljs es6-modules commonjs