Skip to content

Commit

Permalink
Merge branch 'master' into adapter-vercel-remove-target
Browse files Browse the repository at this point in the history
  • Loading branch information
Rich-Harris committed Apr 20, 2022
2 parents ad04115 + e82fe2b commit be14ee2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/lucky-glasses-sell.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@sveltejs/adapter-netlify': patch
---

Ensure build directory exists before writing \_redirects
3 changes: 2 additions & 1 deletion packages/adapter-netlify/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { appendFileSync, existsSync, readFileSync, writeFileSync } from 'fs';
import { join, resolve, posix } from 'path';
import { dirname, join, resolve, posix } from 'path';
import { fileURLToPath } from 'url';
import glob from 'tiny-glob/sync.js';
import esbuild from 'esbuild';
Expand Down Expand Up @@ -234,6 +234,7 @@ function generate_lambda_functions({ builder, publish, split, esm }) {
if (existsSync('_redirects')) {
builder.copy('_redirects', redirect_file);
}
builder.mkdirp(dirname(redirect_file));
appendFileSync(redirect_file, `\n\n${redirects.join('\n')}`);
}

Expand Down

0 comments on commit be14ee2

Please sign in to comment.