mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
fix(cli): missing style deps if component doesn't have style
This commit is contained in:
parent
5389bcf4fb
commit
b9a077b779
@ -1,4 +1,5 @@
|
||||
import { join } from 'path';
|
||||
import { existsSync } from 'fs-extra';
|
||||
import { smartOutputFile } from '../common';
|
||||
import { CSS_LANG, getCssBaseFile } from '../common/css';
|
||||
import { SRC_DIR, STYPE_DEPS_JSON_FILE } from '../common/constant';
|
||||
@ -27,12 +28,17 @@ export function genPacakgeStyle(options: Options) {
|
||||
.map((name: string) => {
|
||||
let path = join(SRC_DIR, `${name}/index${ext}`);
|
||||
|
||||
if (!existsSync(path)) {
|
||||
return '';
|
||||
}
|
||||
|
||||
if (options.pathResolver) {
|
||||
path = options.pathResolver(path);
|
||||
}
|
||||
|
||||
return `@import "${path}";`;
|
||||
})
|
||||
.filter((item: string) => !!item)
|
||||
.join('\n');
|
||||
|
||||
smartOutputFile(options.outputPath, content);
|
||||
|
@ -99,7 +99,7 @@ export async function genStyleDepsMap() {
|
||||
|
||||
const map = {} as DepsMap;
|
||||
|
||||
components.filter(checkStyleExists).forEach(component => {
|
||||
components.forEach(component => {
|
||||
map[component] = analyzeComponentDeps(component);
|
||||
});
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user