Skip to content

Commit

Permalink
refactor: replace globby w/ fast-glob (#418)
Browse files Browse the repository at this point in the history
  • Loading branch information
SukkaW authored Jul 16, 2024
1 parent a987ca7 commit dd4b1a7
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"consola": "^3.2.3",
"defu": "^6.1.4",
"esbuild": "^0.23.0",
"globby": "^14.0.2",
"fast-glob": "^3.3.2",
"hookable": "^5.5.3",
"jiti": "^2.0.0-beta.3",
"magic-string": "^0.30.10",
Expand Down
6 changes: 3 additions & 3 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { consola } from "consola";
import { defu } from "defu";
import { createHooks } from "hookable";
import prettyBytes from "pretty-bytes";
import { globby } from "globby";
import fg from "fast-glob";
import type { RollupOptions } from "rollup";
import { dumpObject, rmdir, resolvePreset, removeExtension } from "./utils";
import type { BuildContext, BuildConfig, BuildOptions } from "./types";
Expand Down Expand Up @@ -289,7 +289,7 @@ async function _build(
consola.success(colors.green("Build succeeded for " + options.name));

// Find all dist files and add missing entries as chunks
const outFiles = await globby("**", { cwd: options.outDir });
const outFiles = await fg("**", { cwd: options.outDir });
for (const file of outFiles) {
let entry = ctx.buildEntries.find((e) => e.path === file);
if (!entry) {
Expand Down
4 changes: 2 additions & 2 deletions src/builders/copy/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { promises as fsp } from "node:fs";
import { relative, resolve } from "pathe";
import { globby } from "globby";
import fg from "fast-glob";
import { symlink, rmdir, warn } from "../../utils";
import type { CopyBuildEntry, BuildContext } from "../../types";
import consola from "consola";
Expand All @@ -18,7 +18,7 @@ export async function copyBuild(ctx: BuildContext): Promise<void> {
await rmdir(distDir);
await symlink(entry.input, distDir);
} else {
const paths = await globby(entry.pattern || ["**"], {
const paths = await fg(entry.pattern || ["**"], {
cwd: resolve(ctx.options.rootDir, entry.input),
absolute: false,
});
Expand Down

0 comments on commit dd4b1a7

Please sign in to comment.