Skip to content

Commit

Permalink
fix: pass relative ignore paths when scanning public assets (#1632)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe authored Aug 25, 2023
1 parent 6c67404 commit b4967ff
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion src/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,13 @@ export async function copyPublicAssets(nitro: Nitro) {
cwd: srcDir,
absolute: false,
dot: true,
ignore: nitro.options.ignore,
ignore: nitro.options.ignore
.map((p) =>
p.startsWith("*") || p.startsWith("!*")
? p
: relative(srcDir, resolve(nitro.options.srcDir, p))
)
.filter((p) => !p.startsWith("../")),
});
await Promise.all(
publicAssets.map(async (file) => {
Expand Down
2 changes: 1 addition & 1 deletion test/fixture/nitro.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export default defineNitroConfig({
dir: "files",
},
],
ignore: ["api/**/_*", "middleware/_ignored.ts", "routes/_*.ts", "_*.txt"],
ignore: ["api/**/_*", "middleware/_ignored.ts", "routes/_*.ts", "**/_*.txt"],
appConfig: {
"nitro-config": true,
dynamic: "initial",
Expand Down

0 comments on commit b4967ff

Please sign in to comment.