Skip to content

Commit

Permalink
use glob
Browse files Browse the repository at this point in the history
  • Loading branch information
gurgunday committed Feb 2, 2024
1 parent ca3606a commit 0194e69
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -421,12 +421,14 @@ async function fastifyStatic (fastify, opts) {
rootPath += '/'
}

let hashSkip
if (opts.hashSkip) hashSkip = globSync(opts.hashSkip, { cwd: rootPath, absolute: false, follow: true, nodir: true, dot: opts.serveDotFiles })
const files = globSync(`${rootPath}**/**`, { follow: true, nodir: true, dot: opts.serveDotFiles })
for (let file of files) {
file = file.split(path.win32.sep).join(path.posix.sep)
const fileRelative = path.posix.relative(rootPath, file)

if (opts.hashSkip?.includes(fileRelative)) {
if (hashSkip?.includes(fileRelative)) {
fileHashes.set(
fileRelative,
fileRelative
Expand Down

0 comments on commit 0194e69

Please sign in to comment.