Skip to content

Commit ff6b17f

Browse files
committed
feat(core): add support to ignore files while providing dir
1 parent c72ad16 commit ff6b17f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

packages/core/src/loader.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { lstatSync, readdirSync, statSync } from "fs";
2-
import { join } from "path";
2+
import { join, sep } from "path";
33

44
import { LesyCommand } from "./command";
55
import { LesyFeature } from "./feature";
@@ -193,7 +193,9 @@ class LesyLoader {
193193
}
194194

195195
private isAllowedFile(path: string) {
196-
if (path.startsWith("_")) return false;
196+
const pathSegments = path.split(sep);
197+
const fileName = pathSegments[pathSegments.length - 1];
198+
if (fileName.startsWith("_")) return false;
197199
const ext = path.split(".");
198200
const lastIndex = ext.length - 1;
199201
if (process.env.LESY_LANG === "js") {

0 commit comments

Comments
 (0)