From b4dbd001cc9e644e2f4d30d691eb8a8748982ebd Mon Sep 17 00:00:00 2001 From: Ben McCann <322311+benmccann@users.noreply.github.com> Date: Sat, 31 Jul 2021 20:41:33 -0700 Subject: [PATCH] [chore] update Netlify build output locations --- .changeset/many-pugs-work.md | 5 +++++ packages/adapter-netlify/README.md | 6 +++--- packages/adapter-netlify/files/entry.js | 2 +- packages/adapter-netlify/index.js | 4 ++-- 4 files changed, 11 insertions(+), 6 deletions(-) create mode 100644 .changeset/many-pugs-work.md diff --git a/.changeset/many-pugs-work.md b/.changeset/many-pugs-work.md new file mode 100644 index 000000000000..e86d67378034 --- /dev/null +++ b/.changeset/many-pugs-work.md @@ -0,0 +1,5 @@ +--- +'@sveltejs/adapter-netlify': patch +--- + +update build output locations" diff --git a/packages/adapter-netlify/README.md b/packages/adapter-netlify/README.md index 32b0e857cefe..b7248d1bef4d 100644 --- a/packages/adapter-netlify/README.md +++ b/packages/adapter-netlify/README.md @@ -32,11 +32,11 @@ Then, make sure you have a [netlify.toml](https://docs.netlify.com/configure-bui ```toml [build] command = "npm run build" - publish = "build/" - functions = "functions/" + publish = ".svelte-kit/netlify/build/" + functions = ".svelte-kit/netlify/functions/" ``` -It's recommended that you add the `build` and `functions` folders (or whichever other folders you specify) to your `.gitignore`. +In this example, we placed the `build` and `functions` folders under `.svelte-kit/netlify`. If you specify another location, you will probably also want to add them to your `.gitignore`. ## Netlify alternatives to SvelteKit functionality diff --git a/packages/adapter-netlify/files/entry.js b/packages/adapter-netlify/files/entry.js index 4ad61b319f55..4f295867b9e7 100644 --- a/packages/adapter-netlify/files/entry.js +++ b/packages/adapter-netlify/files/entry.js @@ -1,5 +1,5 @@ // TODO hardcoding the relative location makes this brittle -import { init, render } from '../output/server/app.js'; // eslint-disable-line import/no-unresolved +import { init, render } from '../../output/server/app.js'; // eslint-disable-line import/no-unresolved import { isContentTypeTextual } from '@sveltejs/kit/adapter-utils'; // eslint-disable-line import/no-unresolved init(); diff --git a/packages/adapter-netlify/index.js b/packages/adapter-netlify/index.js index 1dfbeaa95913..fa34b879e383 100644 --- a/packages/adapter-netlify/index.js +++ b/packages/adapter-netlify/index.js @@ -29,11 +29,11 @@ export default function (options) { utils.update_ignores({ patterns: [publish, functions] }); utils.log.minor('Generating serverless function...'); - utils.copy(join(files, 'entry.js'), '.svelte-kit/netlify/entry.js'); + utils.copy(join(files, 'entry.js'), '.svelte-kit/netlify/intermediate/entry.js'); /** @type {BuildOptions} */ const defaultOptions = { - entryPoints: ['.svelte-kit/netlify/entry.js'], + entryPoints: ['.svelte-kit/netlify/intermediate/entry.js'], outfile: join(functions, 'render/index.js'), bundle: true, inject: [join(files, 'shims.js')],