Skip to content

Commit

Permalink
allow for multiple serverEntryPoints
Browse files Browse the repository at this point in the history
  • Loading branch information
benmccann committed Nov 25, 2021
1 parent 06b020e commit d6fc153
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion packages/adapter-netlify/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import toml from '@iarna/toml';
export default function () {
return {
name: '@sveltejs/adapter-netlify',
serverEntryPoint: '@sveltejs/adapter-netlify/entry',
serverEntryPoints: {index: '@sveltejs/adapter-netlify/entry'},

async adapt({ utils }) {
// "build" is the default publish directory when Netlify detects SvelteKit
Expand Down
2 changes: 1 addition & 1 deletion packages/adapter-node/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export default function ({
} = {}) {
return {
name: '@sveltejs/adapter-node',
serverEntryPoint,
serverEntryPoints: { index: serverEntryPoint },

async adapt({ utils }) {
utils.rimraf(out);
Expand Down
6 changes: 3 additions & 3 deletions packages/kit/src/core/build/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -460,9 +460,9 @@ async function build_server(
const input = {
app: app_file
};
const server_entry_point = config.kit?.adapter?.serverEntryPoint;
if (server_entry_point) {
input.index = server_entry_point;
const server_entry_points = config.kit?.adapter?.serverEntryPoints;
if (server_entry_points) {
Object.assign(input, server_entry_points);
}

/** @type {[any, string[]]} */
Expand Down
2 changes: 1 addition & 1 deletion packages/kit/types/config.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export interface AdapterUtils {

export interface Adapter {
name: string;
serverEntryPoint?: string;
serverEntryPoints: Record<string, string>;
adapt(context: { utils: AdapterUtils; config: ValidatedConfig }): Promise<void>;
}

Expand Down

0 comments on commit d6fc153

Please sign in to comment.