Skip to content

Commit

Permalink
fix(codemod): should not transform when specific file is not .less
Browse files Browse the repository at this point in the history
  • Loading branch information
dengfuping committed Oct 30, 2023
1 parent a42344d commit c163909
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/codemod/transforms/less-to-token.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ const findAllLessFiles = dir => {
files.forEach(file => {
const filePath = path.join(dir, file);
if (isDirectory.sync(filePath)) {
if (filePath.includes('.umi')) {
if (filePath.includes('.umi') || filePath.includes('.umi-production')) {
return;
}
lessFiles.push(...findAllLessFiles(filePath));
} else if (file.endsWith('.less')) {
lessFiles.push(filePath);
}
});
} else {
} else if (dir.endsWith('.less')) {
lessFiles.push(dir);
}
return lessFiles;
Expand Down

0 comments on commit c163909

Please sign in to comment.