Skip to content

Commit

Permalink
[chore] update Netlify build output locations
Browse files Browse the repository at this point in the history
  • Loading branch information
benmccann committed Aug 1, 2021
1 parent 3e30a1b commit b4dbd00
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
5 changes: 5 additions & 0 deletions .changeset/many-pugs-work.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@sveltejs/adapter-netlify': patch
---

update build output locations"
6 changes: 3 additions & 3 deletions packages/adapter-netlify/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion packages/adapter-netlify/files/entry.js
Original file line number Diff line number Diff line change
@@ -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();
Expand Down
4 changes: 2 additions & 2 deletions packages/adapter-netlify/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')],
Expand Down

0 comments on commit b4dbd00

Please sign in to comment.