mirror of
https://github.com/youzan/vant.git
synced 2025-10-21 11:17:41 +00:00
fix(vant-cli): fix Windows system build style problems (#5655)
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
* Build style entry of all components
|
||||
*/
|
||||
|
||||
import { join, relative } from 'path';
|
||||
import { sep, join, relative } from 'path';
|
||||
import { outputFileSync } from 'fs-extra';
|
||||
import { getComponents, replaceExt } from '../common';
|
||||
import { CSS_LANG, getCssBaseFile } from '../common/css';
|
||||
@@ -72,7 +72,7 @@ function genEntry(params: {
|
||||
}
|
||||
|
||||
content += depsPath.map(template).join('\n');
|
||||
|
||||
content = content.replace(new RegExp('\\' + sep, 'g'), '/');
|
||||
outputFileSync(outputFile, content);
|
||||
});
|
||||
}
|
||||
|
@@ -1,4 +1,4 @@
|
||||
import { join } from 'path';
|
||||
import { relative, sep, join } from 'path';
|
||||
import { CSS_LANG } from '../common/css';
|
||||
import { existsSync } from 'fs-extra';
|
||||
import { getDeps, clearDepsCache, fillExt } from './get-deps';
|
||||
@@ -6,10 +6,9 @@ import { getComponents, smartOutputFile } from '../common';
|
||||
import { SRC_DIR, STYPE_DEPS_JSON_FILE } from '../common/constant';
|
||||
|
||||
function matchPath(path: string, component: string): boolean {
|
||||
return path
|
||||
.replace(SRC_DIR, '')
|
||||
.split('/')
|
||||
.includes(component);
|
||||
const p = relative(SRC_DIR, path);
|
||||
const arr = p.split(sep);
|
||||
return arr.includes(component);
|
||||
}
|
||||
|
||||
function getStylePath(component: string) {
|
||||
|
Reference in New Issue
Block a user