Skip to content

Commit

Permalink
fix: only add known ignore patterns by default (#279)
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 authored Dec 28, 2024
1 parent d7819d9 commit 4800bfc
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions src/make.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,21 +49,9 @@ export async function mkdist(
}

// Scan input files
const ignored = await fsp
.readFile(resolve(options.rootDir, ".gitignore"), "utf8")
.then((r) =>
r
.split("\n")
.map((r) => r.trim())
.filter((r) => r && !r.startsWith("#"))
// Gitignore => Glob
// TODO: https://github.com/unjs/mkdist/issues/271
.map((r) => (r.startsWith("/") ? r.slice(1) : r)),
)
.catch(() => []);
const filePaths = await glob(options.pattern || "**", {
absolute: false,
ignore: ignored,
ignore: ["**/node_modules", "**/coverage", "**/.git"],
cwd: options.srcDir,
dot: true,
...options.globOptions,
Expand Down

0 comments on commit 4800bfc

Please sign in to comment.