This is an automated email from the ASF dual-hosted git repository.
shenyi pushed a commit to branch next-npm-env
in repository https://gitbox.apache.org/repos/asf/incubator-echarts.git
The following commit(s) were added to refs/heads/next-npm-env by this push:
new 8040f54 chore: fix extension build
8040f54 is described below
commit 8040f542f4debc4825af831336988884a29e51eb
Author: pissang <[email protected]>
AuthorDate: Tue Jul 28 11:19:00 2020 +0800
chore: fix extension build
---
build/build.js | 9 ++++++++-
build/config.js | 22 ++++++++++++++--------
build/release.js | 6 +++++-
3 files changed, 27 insertions(+), 10 deletions(-)
diff --git a/build/build.js b/build/build.js
index 341e3f6..b46c032 100755
--- a/build/build.js
+++ b/build/build.js
@@ -148,8 +148,15 @@ async function run() {
else if (isPrePublish) {
await prePublish();
}
+ else if (opt.type === 'extension') {
+ const cfgs = [
+ config.createBMap(),
+ config.createDataTool()
+ ];
+ await build(cfgs, opt.min);
+ }
else {
- let cfg = config.createECharts(opt);
+ const cfg = config.createECharts(opt);
await build([cfg], opt.min);
if (opt.removeDev) {
diff --git a/build/config.js b/build/config.js
index f5a6479..3d5c67f 100644
--- a/build/config.js
+++ b/build/config.js
@@ -33,6 +33,13 @@ function preparePlugins(
) {
assert(include);
+ // In case node_modules/zrender is a symlink
+ const zrNodeModulePath = nodePath.resolve(ecDir, 'node_modules/zrender');
+ const zrRealPath = fs.realpathSync(zrNodeModulePath);
+ if (zrRealPath !== zrNodeModulePath) {
+ include.push(zrRealPath + '/**/*.ts');
+ }
+
if (clean) {
console.log('Built in clean mode without cache.');
}
@@ -117,12 +124,6 @@ exports.createECharts = function (opt = {}) {
nodePath.resolve(ecDir, 'src/**/*.ts'),
nodePath.resolve(ecDir, 'echarts*.ts')
];
- // In case node_modules/zrender is a symlink
- const zrNodeModulePath = nodePath.resolve(ecDir, 'node_modules/zrender');
- const zrRealPath = fs.realpathSync(zrNodeModulePath);
- if (zrRealPath !== zrNodeModulePath) {
- include.push(zrRealPath + '/**/*.ts');
- }
return {
plugins: preparePlugins(opt, {
@@ -165,7 +166,10 @@ exports.createBMap = function () {
let input = nodePath.resolve(ecDir, `extension-src/bmap/bmap.ts`);
return {
- plugins: preparePlugins({}, {
+ plugins: preparePlugins({
+ // Always clean
+ clean: true
+ }, {
include: [
nodePath.resolve(ecDir, 'extension-src/bmap/**/*.ts')
]
@@ -194,7 +198,9 @@ exports.createDataTool = function () {
let input = nodePath.resolve(ecDir, `extension-src/dataTool/index.ts`);
return {
- plugins: preparePlugins({}, {
+ plugins: preparePlugins({
+ clean: true
+ }, {
include: [
nodePath.resolve(ecDir, 'extension-src/dataTool/**/*.ts')
]
diff --git a/build/release.js b/build/release.js
index 36287ca..defeeaf 100644
--- a/build/release.js
+++ b/build/release.js
@@ -44,7 +44,7 @@ function release() {
[
'', 'en'
].forEach(function (lang) {
- ['', 'simple', 'common'].forEach(function (type) {
+ ['', 'simple', 'common', 'extension'].forEach(function (type) {
const args = [
`--lang`,
@@ -56,6 +56,10 @@ function release() {
`--min`
];
+ if (lang === 'en' && type === 'extension') {
+ return;
+ }
+
const p = spawn(path.join(__dirname, 'build.js'), args);
const scope = `[${lang || 'zh'}] [${type || 'all'}]`;
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]