From 6b06da84b2454f42cbf7e8bcb643169af74428db Mon Sep 17 00:00:00 2001 From: Adam <32829904+adamjkb@users.noreply.github.com> Date: Thu, 1 Sep 2022 00:04:07 +0100 Subject: [PATCH] Fix adapter to only glob files (#6492) --- .changeset/cold-penguins-share.md | 5 +++++ packages/adapter-netlify/index.js | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changeset/cold-penguins-share.md diff --git a/.changeset/cold-penguins-share.md b/.changeset/cold-penguins-share.md new file mode 100644 index 000000000000..0e267cbde892 --- /dev/null +++ b/.changeset/cold-penguins-share.md @@ -0,0 +1,5 @@ +--- +'@sveltejs/adapter-netlify': patch +--- + +Update adapter to only glob files diff --git a/packages/adapter-netlify/index.js b/packages/adapter-netlify/index.js index 4528b8a3c6a6..cb99dfab4d2e 100644 --- a/packages/adapter-netlify/index.js +++ b/packages/adapter-netlify/index.js @@ -163,7 +163,7 @@ async function generate_lambda_functions({ builder, publish, split, esm }) { if (esm) { builder.copy(`${files}/esm`, '.netlify', { replace }); } else { - glob('**/*.js', { cwd: '.netlify/server' }).forEach((file) => { + glob('**/*.js', { cwd: '.netlify/server', filesOnly: true }).forEach((file) => { const filepath = `.netlify/server/${file}`; const input = readFileSync(filepath, 'utf8'); const output = esbuild.transformSync(input, { format: 'cjs', target: 'node12' }).code;