From e09e26c59e5ab6d7fa12ff301b57cefdca16e692 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=97=8D?= <50108258+kwaa@users.noreply.github.com> Date: Tue, 8 Mar 2022 18:03:38 +0800 Subject: [PATCH] =?UTF-8?q?feat(adapter):=20=E2=9C=A8=20support=20adapter-?= =?UTF-8?q?node?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 1 + pnpm-lock.yaml | 8 ++++++++ svelte.config.js | 5 ++++- 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index a2c32653..2703be0f 100644 --- a/package.json +++ b/package.json @@ -21,6 +21,7 @@ "@iconify-json/heroicons-outline": "^1.1.1", "@iconify-json/heroicons-solid": "^1.1.1", "@sveltejs/adapter-auto": "^1.0.0-next.31", + "@sveltejs/adapter-node": "^1.0.0-next.71", "@sveltejs/adapter-static": "^1.0.0-next.29", "@sveltejs/kit": "^1.0.0-next.294", "@tailwindcss/typography": "^0.5.2", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index fb789aee..f28c7ccf 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -4,6 +4,7 @@ specifiers: '@iconify-json/heroicons-outline': ^1.1.1 '@iconify-json/heroicons-solid': ^1.1.1 '@sveltejs/adapter-auto': ^1.0.0-next.31 + '@sveltejs/adapter-node': ^1.0.0-next.71 '@sveltejs/adapter-static': ^1.0.0-next.29 '@sveltejs/kit': ^1.0.0-next.294 '@tailwindcss/typography': ^0.5.2 @@ -52,6 +53,7 @@ devDependencies: '@iconify-json/heroicons-outline': 1.1.1 '@iconify-json/heroicons-solid': 1.1.1 '@sveltejs/adapter-auto': 1.0.0-next.31 + '@sveltejs/adapter-node': 1.0.0-next.71 '@sveltejs/adapter-static': 1.0.0-next.29 '@sveltejs/kit': 1.0.0-next.294_svelte@3.46.4 '@tailwindcss/typography': 0.5.2_tailwindcss@3.0.23 @@ -341,6 +343,12 @@ packages: tiny-glob: 0.2.9 dev: true + /@sveltejs/adapter-node/1.0.0-next.71: + resolution: {integrity: sha512-ELSQBSyk0IHMRi5Zct95jP+lTUJ0VQ/d7DxPMQTaDYVexpehDBOV6bXDzSNBl9boIIfEv77VD3lA7kgtuJnGdg==} + dependencies: + tiny-glob: 0.2.9 + dev: true + /@sveltejs/adapter-static/1.0.0-next.29: resolution: {integrity: sha512-0hjGnfT3BRyoHnzJ2w0/xL+xICRpKneDTm45ZzggiRrc0r71WJfF6toGeg8N4QUQnj8EJ3Itm453gsS1kt7VUQ==} dependencies: diff --git a/svelte.config.js b/svelte.config.js index 4a5e9337..02636d66 100644 --- a/svelte.config.js +++ b/svelte.config.js @@ -1,5 +1,6 @@ import preprocess from 'svelte-preprocess' import adapterAuto from '@sveltejs/adapter-auto' +import adapterNode from '@sveltejs/adapter-node' import adapterStatic from '@sveltejs/adapter-static' import { mdsvex } from 'mdsvex' import { mdsvexConfig } from './mdsvex.config.js' @@ -21,7 +22,9 @@ const config = { kit: { adapter: Object.keys(process.env).some(key => ['VERCEL', 'CF_PAGES', 'NETLIFY'].includes(key)) ? adapterAuto() - : adapterStatic({ + : process.env.ADAPTER === 'node' + ? adapterNode({ out: 'build' }) + : adapterStatic({ pages: 'build', assets: 'build', fallback: null