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



##########
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:
       As for the UMD header, it may be better to use the same block with 
rollup. 
   ```js
   (function (global, factory) {
       typeof exports === 'object' && typeof module !== 'undefined' ? 
factory(exports) :
       typeof define === 'function' && define.amd ? define(['exports'], 
factory) :
       (global = typeof globalThis !== 'undefined' ? globalThis : global || 
self, factory(global.echarts = {}));
   }(this, (function (exports) {
       // ...
   })));
   ```




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