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 10:38:44 UTC

[incubator-echarts-examples] branch next updated: test: only bundle one file to increase test accuracy

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 b187c77  test: only bundle one file to increase test accuracy
b187c77 is described below

commit b187c774dd0970105aa5a013b4557d376c93a584
Author: pissang <bm...@gmail.com>
AuthorDate: Wed Dec 30 18:38:32 2020 +0800

    test: only bundle one file to increase test accuracy
---
 package.json           |  1 +
 test/main.js           |  3 ++-
 test/webpack.config.js | 20 ++++++++++++++++++++
 3 files changed, 23 insertions(+), 1 deletion(-)

diff --git a/package.json b/package.json
index 7c952d4..57acf9c 100644
--- a/package.json
+++ b/package.json
@@ -46,6 +46,7 @@
     "vue-loader": "^15.9.2",
     "vue-template-compiler": "^2.6.11",
     "webpack": "^4.43.0",
+    "webpack-bundle-analyzer": "^4.3.0",
     "webpack-cli": "^3.3.11",
     "yargs": "^6.6.0"
   },
diff --git a/test/main.js b/test/main.js
index a65313c..2de5eac 100644
--- a/test/main.js
+++ b/test/main.js
@@ -344,7 +344,8 @@ function esbuildBundle(entry, result, minify) {
 async function bundle(entryFiles, result) {
     if (USE_WEBPACK) {
         // Split to multiple buckets to seepup bundle
-        const BUCKET_SIZE = 50;
+        // TODO Multiple entry may have effects on the final bundle.
+        const BUCKET_SIZE = 1;
         const buckets = [];
         const esbuildService = await esbuild.startService();
         let count = 0;
diff --git a/test/webpack.config.js b/test/webpack.config.js
new file mode 100644
index 0000000..9d8c056
--- /dev/null
+++ b/test/webpack.config.js
@@ -0,0 +1,20 @@
+const path = require('path');
+const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
+const config = require('./config');
+
+module.exports = {
+    entry: path.resolve(__dirname, 'tmp/tests/area-basic.minimal.js'),
+    plugins: [
+        new BundleAnalyzerPlugin()
+    ],
+    resolve: {
+        alias: {
+            echarts: config.echartsDir,
+            zrender: config.zrenderDir
+        }
+    },
+    output: {
+        path: path.resolve(__dirname, 'tmp/bundles/'),
+        filename: 'area-basic.minimal.js'
+    }
+}
\ No newline at end of file


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