feat(cli): support custom src dir

This commit is contained in:
陈嘉涵
2019-12-05 17:18:44 +08:00
parent 8fd530e131
commit ebe5f6ebfd
2 changed files with 28 additions and 12 deletions
+2 -8
View File
@@ -7,7 +7,7 @@ import {
readFileSync,
outputFileSync
} from 'fs-extra';
import { SRC_DIR, WEBPACK_CONFIG_FILE, VANT_CONFIG_FILE } from './constant';
import { SRC_DIR, getVantConfig, WEBPACK_CONFIG_FILE } from './constant';
export const EXT_REGEXP = /\.\w+$/;
export const SFC_REGEXP = /\.(vue)$/;
@@ -80,12 +80,6 @@ export function pascalize(str: string): string {
);
}
export function getVantConfig() {
delete require.cache[VANT_CONFIG_FILE];
return require(VANT_CONFIG_FILE);
}
export function getWebpackConfig(): object {
if (existsSync(WEBPACK_CONFIG_FILE)) {
const config = require(WEBPACK_CONFIG_FILE);
@@ -129,4 +123,4 @@ export function smartOutputFile(filePath: string, content: string) {
outputFileSync(filePath, content);
}
export { decamelize };
export { decamelize, getVantConfig };