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/30 06:38:55 UTC

[incubator-echarts-examples] branch next updated: test: still use echarts/lib/echarts instead of echarts/index.blank to avoid too much confusion

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 20148ad  test: still use echarts/lib/echarts instead of echarts/index.blank to avoid too much confusion
20148ad is described below

commit 20148ad90718c5f7d80c82442f6997edc321b741
Author: pissang <bm...@gmail.com>
AuthorDate: Wed Dec 30 14:38:41 2020 +0800

    test: still use echarts/lib/echarts instead of echarts/index.blank to avoid too much confusion
---
 common/buildCode.js |  4 ++--
 test/main.js        | 13 ++++++++-----
 2 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/common/buildCode.js b/common/buildCode.js
index c9f7e87..181f2ba 100644
--- a/common/buildCode.js
+++ b/common/buildCode.js
@@ -205,11 +205,11 @@ function buildLegacyMinimalImportCode(deps, isESM) {
         }
     });
 
-    return isESM ? `import * as echarts from 'echarts/index.blank';
+    return isESM ? `import * as echarts from 'echarts/lib/echarts';
 ${modules.map(mod => {
     return `import '${mod}';`;
 }).join('\n')}
-` : `const echarts = require('echarts/index.blank');
+` : `const echarts = require('echarts/lib/echarts');
 ${modules.map(mod => {
     return `require('${mod}');`;
 }).join('\n')}
diff --git a/test/main.js b/test/main.js
index 59a6999..5d9f53e 100644
--- a/test/main.js
+++ b/test/main.js
@@ -22,7 +22,8 @@ const BUNDLE_DIR = `${TMP_DIR}/bundles`;
 const SCREENSHOTS_DIR = `${TMP_DIR}/screenshots`;
 
 const MINIFY_BUNDLE = true;
-const TEST_THEME = 'dark-blue';
+// const TEST_THEME = 'dark-blue';
+const TEST_THEME = '';
 
 const TEMPLATE_CODE = `
 echarts.registerPreprocessor(function (option) {
@@ -43,7 +44,7 @@ echarts.registerPreprocessor(function (option) {
 });
 `
 
-function buildPrepareCode(isESM) {
+function buildPrepareCode(isESM, lang) {
     return `
 ${isESM
     ? `import _seedrandom from 'seedrandom';`
@@ -51,9 +52,11 @@ ${isESM
 }
 
 // Check if i18n will break the minimal imports.
-${isESM
-    ? `import 'echarts/i18n/langJA';`
-    : `require('echarts/i18n/langJA');`
+${lang
+    ? isESM
+        ? `import 'echarts/i18n/${lang}';`
+        : `require('echarts/i18n/${lang}');`
+    : ''
 }
 
 const _myrng = _seedrandom('echarts');


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