chore: generate-cssinjs.ts run wrong in windows (#51264)

This commit is contained in:
kaqiinono 2024-10-16 17:57:53 +08:00 committed by GitHub
parent 9a47f89298
commit de58553e98
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -25,7 +25,7 @@ export const generateCssinjs = ({ key, beforeRender, render }: GenCssinjsOptions
Promise.all( Promise.all(
styleFiles.map(async (file) => { styleFiles.map(async (file) => {
const absPath = url.pathToFileURL(file).href; const absPath = url.pathToFileURL(file).href;
const pathArr = file.split('/'); const pathArr = file.split(path.sep);
const styleIndex = pathArr.lastIndexOf('style'); const styleIndex = pathArr.lastIndexOf('style');
const componentName = pathArr[styleIndex - 1]; const componentName = pathArr[styleIndex - 1];
let useStyle: StyleFn = () => {}; let useStyle: StyleFn = () => {};