feat(cli): add css.removeSourceFile config (#10750)

This commit is contained in:
neverland
2022-06-26 17:15:11 +08:00
committed by GitHub
parent e61d85a890
commit bb23e1b700
4 changed files with 48 additions and 4 deletions
@@ -12,6 +12,7 @@ import {
ES_DIR,
SRC_DIR,
LIB_DIR,
getVantConfig,
STYLE_DEPS_JSON_FILE,
} from '../common/constant.js';
@@ -87,8 +88,10 @@ export function genComponentStyle(
delete require.cache[STYLE_DEPS_JSON_FILE];
}
const vantConfig = getVantConfig();
const components = getComponents();
const baseFile = getCssBaseFile();
const hasSourceFile = vantConfig.build?.css?.removeSourceFile !== true;
components.forEach((component) => {
genEntry({
@@ -98,7 +101,7 @@ export function genComponentStyle(
ext: '.css',
});
if (CSS_LANG !== 'css') {
if (CSS_LANG !== 'css' && hasSourceFile) {
genEntry({
baseFile,
component,