disable new minimal import util new version is released
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 @@
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 @@
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 @@
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 @@
});
const legacyCode = buildExampleCode(buildPrepareCode(false) + jsCode, deps, {
minimal: true,
- legacy: true,
esm: false,
ts: false,
theme: TEST_THEME,