susiwen8 commented on a change in pull request #16619:
URL: https://github.com/apache/echarts/pull/16619#discussion_r821771140



##########
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:
       The reason why I have change `exports` to `module` is that `esbuild` 
generate `module.exports = ___toCommonJS(****)` at the end of file if we chose 
`cjs` format.
   Cause in browser environment, `module` is not a global variable as in 
`node`.  It will throw `module is not defined` in browser.




-- 
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]

Reply via email to