mirror of
https://github.com/youzan/vant.git
synced 2025-10-20 10:44:59 +00:00
feat(cli): build style entry
This commit is contained in:
@@ -88,13 +88,15 @@ export async function compileSfc(filePath: string) {
|
||||
}
|
||||
|
||||
// compile style part
|
||||
styles.forEach(async (style, index: number) => {
|
||||
const prefix = index !== 0 ? `-${index + 1}` : '';
|
||||
const ext = style.lang || 'css';
|
||||
const cssFilePath = replaceExt(filePath, `${prefix}.${ext}`);
|
||||
await Promise.all(
|
||||
styles.map((style, index: number) => {
|
||||
const prefix = index !== 0 ? `-${index + 1}` : '';
|
||||
const ext = style.lang || 'css';
|
||||
const cssFilePath = replaceExt(filePath, `-sfc${prefix}.${ext}`);
|
||||
|
||||
writeFileSync(cssFilePath, trim(style.content));
|
||||
writeFileSync(cssFilePath, trim(style.content));
|
||||
|
||||
await compileStyle(cssFilePath);
|
||||
});
|
||||
return compileStyle(cssFilePath);
|
||||
})
|
||||
);
|
||||
}
|
||||
|
Reference in New Issue
Block a user