提交 dbb3315a 编写于 作者: P pissang

chore: watch zrender files change in dev.

上级 09d3b496
......@@ -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();
// }
});
}
......
......@@ -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
}
};
};
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册