[英]How can I re-export with CJS?
How can I re-export modules in CJS?如何在 CJS 中重新导出模块? What would be the CJS equivalent to the following ES6 code?与以下 ES6 代码等效的 CJS 是什么?
export * from './lib/setAttribute.js'
I think you can do exactly the same way that tsc
currently does as it compiles our code back to commonjs
:我认为您可以按照tsc
当前所做的完全相同的方式将我们的代码编译回commonjs
:
var __createBinding = function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
};
var __exportStar = function(m, exports) {
for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p);
};
__exportStar(require("./lib/setAttribute.js"), exports);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.