@sveltejs/adapter-netlify
Advanced tools
Comparing version 1.0.0-next.4 to 1.0.0-next.5
# @sveltejs/adapter-netlify | ||
## 1.0.0-next.5 | ||
### Patch Changes | ||
- 6e27880: Move server-side fetch to adapters instead of build step | ||
## 1.0.0-next.4 | ||
@@ -4,0 +10,0 @@ |
@@ -5,3 +5,10 @@ 'use strict'; | ||
import { render } from './app.mjs'; // eslint-disable-line import/no-unresolved | ||
import fetch, { Response, Request, Headers } from 'node-fetch'; | ||
// provide server-side fetch | ||
globalThis.fetch = fetch; | ||
globalThis.Response = Response; | ||
globalThis.Request = Request; | ||
globalThis.Headers = Headers; | ||
export async function handler(event) { | ||
@@ -8,0 +15,0 @@ const { |
12
index.js
@@ -10,3 +10,3 @@ const { existsSync, readFileSync, copyFileSync, writeFileSync, renameSync } = require('fs'); | ||
async adapt(builder) { | ||
async adapt(utils) { | ||
let netlify_config; | ||
@@ -41,5 +41,5 @@ | ||
builder.copy_static_files(publish); | ||
builder.copy_client_files(publish); | ||
builder.copy_server_files(`${functions}/render`); | ||
utils.copy_static_files(publish); | ||
utils.copy_client_files(publish); | ||
utils.copy_server_files(`${functions}/render`); | ||
@@ -59,4 +59,4 @@ // rename app to .mjs | ||
// prerender | ||
builder.log.info('Prerendering static pages...'); | ||
await builder.prerender({ | ||
utils.log.info('Prerendering static pages...'); | ||
await utils.prerender({ | ||
dest: publish | ||
@@ -63,0 +63,0 @@ }); |
{ | ||
"name": "@sveltejs/adapter-netlify", | ||
"version": "1.0.0-next.4", | ||
"version": "1.0.0-next.5", | ||
"main": "index.js", | ||
@@ -8,7 +8,2 @@ "files": [ | ||
], | ||
"scripts": { | ||
"lint": "eslint --ignore-path .gitignore \"**/*.{ts,js,svelte}\" && npm run check-format", | ||
"format": "prettier --write . --config ../../.prettierrc --ignore-path .gitignore", | ||
"check-format": "prettier --check . --config ../../.prettierrc --ignore-path .gitignore" | ||
}, | ||
"dependencies": { | ||
@@ -18,5 +13,10 @@ "toml": "^3.0.0" | ||
"devDependencies": { | ||
"@sveltejs/kit": "1.0.0-next.54", | ||
"@sveltejs/kit": "1.0.0-next.78", | ||
"typescript": "^4.2.3" | ||
}, | ||
"scripts": { | ||
"lint": "eslint --ignore-path .gitignore \"**/*.{ts,js,svelte}\" && npm run check-format", | ||
"format": "prettier --write . --config ../../.prettierrc --ignore-path .gitignore", | ||
"check-format": "prettier --check . --config ../../.prettierrc --ignore-path .gitignore" | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
6483
103
1