diff --git a/build/build.js b/build/build.js index 384831d00fdda9017e9cb1e1ef328790b05f3688..f88d256aebae368b68d055516f0ef49c037f4f18 100755 --- a/build/build.js +++ b/build/build.js @@ -314,7 +314,6 @@ async function build(configs) { */ function watch(singleConfig) { - // FIXME:TS call `ensureZRenderCode` let watcher = rollup.watch(singleConfig); watcher.on('event', function (event) { @@ -338,12 +337,6 @@ function watch(singleConfig) { if (event.code === 'BUNDLE_END') { printWatchResult(event); } - // if (event.code === 'START') { - // ensureZRenderCode.prepare(); - // } - // if (event.code === 'END' || event.code === 'ERROR' || event.code === 'FATAL') { - // ensureZRenderCode.clear(); - // } }); } diff --git a/build/config.js b/build/config.js index 688fbd3f8e7c359c049cc8ecba9f1de8f9d1726b..1f1da3ffc146848d6b4d24bc11a153ee13abd4ca 100644 --- a/build/config.js +++ b/build/config.js @@ -34,12 +34,6 @@ function preparePlugins( {include, exclude} ) { 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.'); @@ -140,14 +134,20 @@ exports.createECharts = function (opt = {}) { output = nodePath.resolve(ecDir, `dist/echarts${postfixLang}${postfixType}${postfixMin}.js`); } + const include = [ + 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, { - include: [ - nodePath.resolve(ecDir, 'src/**/*.ts'), - nodePath.resolve(ecDir, 'echarts*.ts') - // nodePath.resolve(ecDir, '/Users/s/sushuangwork/met/act/tigall/echarts/zrender/src/**/*.ts') - // nodePath.resolve(ecDir, '../zrender/src/**/*.ts') - ] + include }), // external: ['zrender'], @@ -177,13 +177,7 @@ exports.createECharts = function (opt = {}) { file: output }, watch: { - include: [ - nodePath.resolve(ecDir, 'src/**'), - nodePath.resolve(ecDir, 'echarts*.ts'), - // FIXME - // zrender code watch is broken until "ensure zr code" can be removed. - // nodePath.resolve(ecDir, '../zrender/src/**/*.ts') - ] + include } }; };