feat(cli): restart compile when vant config updated

This commit is contained in:
陈嘉涵
2019-12-04 18:10:14 +08:00
parent 2db6e2a44d
commit b19b287276
11 changed files with 152 additions and 105 deletions
@@ -1,10 +1,9 @@
import { join } from 'path';
import { existsSync, ensureDirSync, writeFileSync } from 'fs-extra';
import { decamelize, pascalize, removeExt, getComponents } from '../common';
import { existsSync } from 'fs-extra';
import { decamelize, pascalize, removeExt, getComponents, smartOutputFile } from '../common';
import {
CONFIG,
SRC_DIR,
DIST_DIR,
SITE_MODILE_SHARED_FILE
} from '../common/constant';
@@ -64,6 +63,5 @@ export function genSiteMobileShared() {
const components = getComponents();
const code = genCode(components);
ensureDirSync(DIST_DIR);
writeFileSync(SITE_MODILE_SHARED_FILE, code);
smartOutputFile(SITE_MODILE_SHARED_FILE, code);
}