Skip to content

Commit be14ee2

Browse files
committed
Merge branch 'master' into adapter-vercel-remove-target
2 parents ad04115 + e82fe2b commit be14ee2

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

.changeset/lucky-glasses-sell.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@sveltejs/adapter-netlify': patch
3+
---
4+
5+
Ensure build directory exists before writing \_redirects

packages/adapter-netlify/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { appendFileSync, existsSync, readFileSync, writeFileSync } from 'fs';
2-
import { join, resolve, posix } from 'path';
2+
import { dirname, join, resolve, posix } from 'path';
33
import { fileURLToPath } from 'url';
44
import glob from 'tiny-glob/sync.js';
55
import esbuild from 'esbuild';
@@ -234,6 +234,7 @@ function generate_lambda_functions({ builder, publish, split, esm }) {
234234
if (existsSync('_redirects')) {
235235
builder.copy('_redirects', redirect_file);
236236
}
237+
builder.mkdirp(dirname(redirect_file));
237238
appendFileSync(redirect_file, `\n\n${redirects.join('\n')}`);
238239
}
239240

0 commit comments

Comments
 (0)