Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/torstendittmann/svelte-adapter-static-digitalocean
https://github.com/torstendittmann/svelte-adapter-static-digitalocean
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/torstendittmann/svelte-adapter-static-digitalocean
- Owner: TorstenDittmann
- License: mit
- Created: 2022-03-26T11:20:07.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-09-10T13:56:41.000Z (over 1 year ago)
- Last Synced: 2024-04-12T22:31:31.866Z (8 months ago)
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/svelte-adapter-static-digitalocean
- Size: 81.1 KB
- Stars: 12
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# svelte-adapter-static-digitalocean
Adapter for Svelte apps that extends the official [@sveltejs/adapter-static](https://github.com/sveltejs/kit/tree/master/packages/adapter-static) and does the following to support [DigitalOcean App Platform](https://www.digitalocean.com/products/app-platform) out-of-the-box.
The adapter will also look for an [App Spec](https://docs.digitalocean.com/products/app-platform/concepts/app-spec/) file and adapt the configuration accordingly.
If `static_sites` is provided in the specifications, the adapter will use the first entry. If you want to use a different one, you will need to provide a `name` value to the adapter configuration. It will use the value of `error_document` for the fallback.
If no specification is found or provided, the `fallback` falls back to `404.html` - which is the default for DigitalOcean App Platform.
## Configuration
run `npm install svelte-adapter-static-digitalocean`.
Then add the adapter to your `svelte.config.js`:
```js
import adapter from 'svelte-adapter-static-digitalocean';export default {
kit: {
...
adapter: adapter({
// default options are shown
pages: 'build',
assets: 'build',
fallback: '404.html',
precompress: false,
strict: true,
spec: '.do/spec.yaml',
name: ''
})
}
};
```...and add the prerender option to your root layout (`src/routes/+layout.js|ts`):
```js
// This can be false if you're using a fallback (i.e. SPA mode)
export const prerender = true;
```> Please check out the [@sveltejs/adapter-static](https://github.com/sveltejs/kit/tree/master/packages/adapter-static) readme for more options.
## Issues / Bugs
Please report issues in the [here](https://github.com/torstendittmann/svelte-adapter-static-digitalocean/issues).