pissang commented on a change in pull request #16619:
URL: https://github.com/apache/echarts/pull/16619#discussion_r819212605
##########
File path: test/lib/simpleRequire.js
##########
@@ -142,7 +142,7 @@
var factoryRet = factory.apply(null, deps.map(function (dep) {
return dep === exportsPlaceholder ? modExports : dep;
}));
- return factoryRet || modExports;
+ return factoryRet || modExports.exports || modExports;
Review comment:
Could you explain this change to me? I think this is not same with the
AMD spec
##########
File path: build/dev-fast.js
##########
@@ -20,21 +20,20 @@
const path = require('path');
const {build} = require('esbuild');
-const commander = require('commander');
const outFilePath = path.resolve(__dirname, '../dist/echarts.js');
const umdWrapperHead = `(function (root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['exports'], factory);
- } else if (typeof exports === 'object' && typeof exports.nodeName !==
'string') {
+ } else if (typeof module === 'object' && typeof module.nodeName !==
'string') {
// CommonJS
- factory(exports);
Review comment:
Change `exports` to `module` may behave differently in the CommonJS
environment.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]