@sveltejs/adapter-netlify 2.0.3 → 2.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.js +6 -5
  2. package/package.json +2 -2
package/index.js CHANGED
@@ -1,6 +1,6 @@
1
- import { appendFileSync, existsSync, readdirSync, readFileSync, writeFileSync } from 'fs';
2
- import { dirname, join, resolve, posix } from 'path';
3
- import { fileURLToPath } from 'url';
1
+ import { appendFileSync, existsSync, readdirSync, readFileSync, writeFileSync } from 'node:fs';
2
+ import { dirname, join, resolve, posix } from 'node:path';
3
+ import { fileURLToPath } from 'node:url';
4
4
  import esbuild from 'esbuild';
5
5
  import toml from '@iarna/toml';
6
6
 
@@ -231,8 +231,9 @@ async function generate_lambda_functions({ builder, publish, split }) {
231
231
  writeFileSync(`.netlify/functions-internal/${name}.mjs`, fn);
232
232
  writeFileSync(`.netlify/functions-internal/${name}.json`, fn_config);
233
233
 
234
- redirects.push(`${pattern} /.netlify/functions/${name} 200`);
235
- redirects.push(`${pattern}/__data.json /.netlify/functions/${name} 200`);
234
+ const redirect = `/.netlify/functions/${name} 200`;
235
+ redirects.push(`${pattern} ${redirect}`);
236
+ redirects.push(`${pattern === '/' ? '' : pattern}/__data.json ${redirect}`);
236
237
  }
237
238
  } else {
238
239
  const manifest = builder.generateManifest({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sveltejs/adapter-netlify",
3
- "version": "2.0.3",
3
+ "version": "2.0.4",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/sveltejs/kit",
@@ -38,7 +38,7 @@
38
38
  "rollup": "^3.7.0",
39
39
  "typescript": "^4.9.4",
40
40
  "uvu": "^0.5.6",
41
- "@sveltejs/kit": "^1.5.3"
41
+ "@sveltejs/kit": "^1.5.6"
42
42
  },
43
43
  "peerDependencies": {
44
44
  "@sveltejs/kit": "^1.5.0"