From 2054e0b26fc4dc2ab8c80efc6122db9e62653f9a Mon Sep 17 00:00:00 2001 From: Lachlan Collins <1667261+lachlancollins@users.noreply.github.com> Date: Mon, 18 Dec 2023 15:07:12 +1100 Subject: [PATCH] feat: Use netlify adapter with edge functions (#517) * Test netlify edge functions * Update gitignore --- .gitignore | 1 + package.json | 2 +- pnpm-lock.yaml | 13 ++++++++++--- svelte.config.js | 4 ++-- 4 files changed, 14 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index 850a2c9f4..774be5104 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ .DS_Store .pnpm-store node_modules +/.netlify /.svelte-kit /build /functions diff --git a/package.json b/package.json index fbf006a7f..adbe47a4b 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,7 @@ "@actions/core": "^1.10.1", "@macfja/svelte-persistent-store": "2.4.1", "@sindresorhus/slugify": "^2.2.1", - "@sveltejs/adapter-static": "^3.0.0", + "@sveltejs/adapter-netlify": "^3.0.0", "@sveltejs/kit": "^2.0.1", "@sveltejs/vite-plugin-svelte": "^3.0.1", "@types/eslint": "^8.44.9", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 35631cb10..6c0349107 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -14,7 +14,7 @@ devDependencies: '@sindresorhus/slugify': specifier: ^2.2.1 version: 2.2.1 - '@sveltejs/adapter-static': + '@sveltejs/adapter-netlify': specifier: ^3.0.0 version: 3.0.0(@sveltejs/kit@2.0.1) '@sveltejs/kit': @@ -394,6 +394,10 @@ packages: resolution: {integrity: sha512-dvuCeX5fC9dXgJn9t+X5atfmgQAzUOWqS1254Gh0m6i8wKd10ebXkfNKiRK+1GWi/yTvvLDHpoxLr0xxxeslWw==} dev: true + /@iarna/toml@2.2.5: + resolution: {integrity: sha512-trnsAYxU3xnS1gPHPyU961coFyLkh4gAD/0zQ5mymY4yOZ+CYvsPqUbOFSw0aDM4y0tV7tiFxL/1XfXPNC6IPg==} + dev: true + /@jest/schemas@29.6.3: resolution: {integrity: sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} @@ -600,12 +604,15 @@ packages: escape-string-regexp: 5.0.0 dev: true - /@sveltejs/adapter-static@3.0.0(@sveltejs/kit@2.0.1): - resolution: {integrity: sha512-nNsm8XChhJgQdeVegdXU+EnpznSUlsIjlLJa9SNmvSVN3rcPtB2BAnGuS/EWCtgPLkVcy9V2kW5knronqmF+KQ==} + /@sveltejs/adapter-netlify@3.0.0(@sveltejs/kit@2.0.1): + resolution: {integrity: sha512-b58DAKM+9nnp1WqO+zhXXA62euns8pS8K70N5u0Ld/tUuD15wEZ+oAQ7CBzJqTLsYsHIKgpXto4xwngnF4ZK4A==} peerDependencies: '@sveltejs/kit': ^2.0.0 dependencies: + '@iarna/toml': 2.2.5 '@sveltejs/kit': 2.0.1(@sveltejs/vite-plugin-svelte@3.0.1)(svelte@4.2.8)(vite@5.0.10) + esbuild: 0.19.9 + set-cookie-parser: 2.6.0 dev: true /@sveltejs/kit@2.0.1(@sveltejs/vite-plugin-svelte@3.0.1)(svelte@4.2.8)(vite@5.0.10): diff --git a/svelte.config.js b/svelte.config.js index ead1b487c..42f01c6e3 100644 --- a/svelte.config.js +++ b/svelte.config.js @@ -1,6 +1,6 @@ import path from 'node:path'; import { vitePreprocess } from '@sveltejs/vite-plugin-svelte'; -import adapter from '@sveltejs/adapter-static'; +import adapter from '@sveltejs/adapter-netlify'; import hljs from 'highlight.js'; import { mdsvex, escapeSvelte } from 'mdsvex'; import rehypeSlug from 'rehype-slug'; @@ -30,7 +30,7 @@ const config = { ], extensions: extensions, kit: { - adapter: adapter(), + adapter: adapter({ edge: true }), alias: { $components: path.resolve('./src/lib/components'), $layout: path.resolve('./src/lib/components/layout'),