feat(cli): import base css

This commit is contained in:
陈嘉涵
2019-12-02 17:54:55 +08:00
parent 4299740b5d
commit 6a8a9a6f79
5 changed files with 111 additions and 30 deletions
+13 -2
View File
@@ -1,7 +1,8 @@
import decamelize from 'decamelize';
import { readdirSync, existsSync, lstatSync, readFileSync } from 'fs-extra';
import { join } from 'path';
import { SRC_DIR, WEBPACK_CONFIG_FILE } from './constant';
import { get } from 'lodash';
import { readdirSync, existsSync, lstatSync, readFileSync } from 'fs-extra';
import { CONFIG, SRC_DIR, WEBPACK_CONFIG_FILE } from './constant';
export const EXT_REGEXP = /\.\w+$/;
export const SFC_REGEXP = /\.(vue)$/;
@@ -103,4 +104,14 @@ export function isDev() {
return process.env.NODE_ENV === 'development';
}
export function getCssLang(): string {
const preprocessor = get(CONFIG, 'build.css.preprocessor', 'less');
if (preprocessor === 'sass') {
return 'scss';
}
return preprocessor;
}
export { decamelize };