You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by sh...@apache.org on 2020/12/29 09:20:34 UTC

[incubator-echarts-examples] branch next updated: disable new minimal import util new version is released

This is an automated email from the ASF dual-hosted git repository.

shenyi pushed a commit to branch next
in repository https://gitbox.apache.org/repos/asf/incubator-echarts-examples.git


The following commit(s) were added to refs/heads/next by this push:
     new 8c272e0  disable new minimal import util new version is released
8c272e0 is described below

commit 8c272e0dedb0658f2635d49d135f6d8dce663cca
Author: pissang <bm...@gmail.com>
AuthorDate: Tue Dec 29 17:20:20 2020 +0800

    disable new minimal import util new version is released
---
 common/buildCode.js   | 18 +++++++++---------
 src/editor/Editor.vue |  4 ++--
 test/main.js          |  1 -
 3 files changed, 11 insertions(+), 12 deletions(-)

diff --git a/common/buildCode.js b/common/buildCode.js
index d619b62..c9f7e87 100644
--- a/common/buildCode.js
+++ b/common/buildCode.js
@@ -224,7 +224,7 @@ module.exports.buildExampleCode = function (
         minimal,
         // If is ESM module or CommonJS module
         // Force to be true in ts mode or minimal mode.
-        esm,
+        esm = true,
         // If use legacy minimal import, like:
         // import 'echarts/lib/chart/bar';
         // Only available when minimal is true.
@@ -236,20 +236,20 @@ module.exports.buildExampleCode = function (
         ROOT_PATH
     }
 ) {
-    if (minimal && !legacy) {
-        // ESM must be used when use the new minimal import
-        esm = true;
-    }
-
-    // if (minimal && !esm) {
-    //     // Only legacy mode can be used when use require in mimimal bundle.
-    //     legacy = true;
+    // if (minimal && !legacy) {
+    //     // ESM must be used when use the new minimal import
+    //     esm = true;
     // }
 
     if (ts) {
         esm = true;
     }
 
+    if (minimal && !esm) {
+        // Only legacy mode can be used when use require in mimimal bundle.
+        legacy = true;
+    }
+
 
     const hasECStat = jsCode.indexOf('ecStat') >= 0;
     const usedRootPath = jsCode.indexOf('ROOT_PATH') >= 0;
diff --git a/src/editor/Editor.vue b/src/editor/Editor.vue
index ef82bf2..b52a6e4 100644
--- a/src/editor/Editor.vue
+++ b/src/editor/Editor.vue
@@ -162,8 +162,8 @@ export default {
                 minimal: this.fullCodeConfig.minimal,
                 ts: false,
                 esm: this.fullCodeConfig.esm,
-                // Only legacy mode can be used when use require in mimimal bundle.
-                legacy: !this.fullCodeConfig.esm && this.fullCodeConfig.minimal,
+                // TODO Enabled when new version is published.
+                legacy: true,
                 theme: store.darkMode ? 'dark' : '',
                 ROOT_PATH: store.cdnRoot
             });
diff --git a/test/main.js b/test/main.js
index aa1af44..59a6999 100644
--- a/test/main.js
+++ b/test/main.js
@@ -116,7 +116,6 @@ async function buildRunCode() {
         });
         const legacyCode = buildExampleCode(buildPrepareCode(false) + jsCode, deps, {
             minimal: true,
-            legacy: true,
             esm: false,
             ts: false,
             theme: TEST_THEME,


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org