mirror of
https://github.com/youzan/vant.git
synced 2025-10-16 16:04:04 +00:00
Merge branch '2.x' into dev
This commit is contained in:
@@ -39,7 +39,7 @@ const IMPORT_STYLE_RE = /import\s+?(?:(?:".*?")|(?:'.*?'))[\s]*?(?:;|$|)/g;
|
||||
|
||||
// "import 'a.less';" => "import 'a.css';"
|
||||
export function replaceCssImportExt(code: string) {
|
||||
return code.replace(IMPORT_STYLE_RE, str =>
|
||||
return code.replace(IMPORT_STYLE_RE, (str) =>
|
||||
str.replace(`.${CSS_LANG}`, '.css')
|
||||
);
|
||||
}
|
||||
|
@@ -62,8 +62,8 @@ export function getDeps(filePath: string) {
|
||||
const code = readFileSync(filePath, 'utf-8');
|
||||
const imports = matchImports(code);
|
||||
const paths = imports
|
||||
.map(item => getPathByImport(item, filePath))
|
||||
.filter(item => !!item) as string[];
|
||||
.map((item) => getPathByImport(item, filePath))
|
||||
.filter((item) => !!item) as string[];
|
||||
|
||||
depsMap[filePath] = paths;
|
||||
|
||||
@@ -76,7 +76,7 @@ export function getDeps(filePath: string) {
|
||||
export function replaceScriptImportExt(code: string, from: string, to: string) {
|
||||
const importLines = matchImports(code);
|
||||
|
||||
importLines.forEach(importLine => {
|
||||
importLines.forEach((importLine) => {
|
||||
const result = importLine.replace(from, to);
|
||||
code = code.replace(importLine, result);
|
||||
});
|
||||
|
Reference in New Issue
Block a user