Skip to content

Commit

Permalink
deploy to vercel
Browse files Browse the repository at this point in the history
  • Loading branch information
opensas committed Apr 19, 2021
1 parent 40d96c4 commit 72d057c
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 9 deletions.
5 changes: 4 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
{
"cSpell.words": [
"opensas",
"sveltekit"
"preprocessors",
"sveltejs",
"sveltekit",
"vercel"
]
}
24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,30 @@ Based on the [Landing Page](https://www.tailwindtoolbox.com/templates/landing-pa

![Landing Page](https://www.tailwindtoolbox.com/templates/landing-page.png)

The site is automatically deployed to [vercel](https://vercel.com) using the [SvelteKit vercel adapter](https://github.com/sveltejs/kit/tree/master/packages/adapter-vercel). Check the [documentation](https://kit.svelte.dev/docs#adapters) for other adapters.

## Deploying to vercel

Add `"@sveltejs/adapter-vercel"`: `"next"` to the devDependencies in your `package.json` and run `npm install`.

```shell
pnpm install -D @sveltejs/adapter-vercel
```

Then modify your svelte.config.js:

```javascript
const vercel = require('@sveltejs/adapter-vercel');
...

module.exports = {
kit: {
...
adapter: vercel()
}
};
```

## Running locally

Clone the repo, install dependencies and start the development server:
Expand Down
13 changes: 7 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,25 @@
},
"devDependencies": {
"@sveltejs/adapter-node": "next",
"@sveltejs/adapter-vercel": "next",
"@sveltejs/kit": "next",
"@typescript-eslint/eslint-plugin": "^4.19.0",
"@typescript-eslint/parser": "^4.19.0",
"autoprefixer": "^10.2.5",
"cssnano": "^5.0.1",
"eslint": "^7.22.0",
"eslint-config-prettier": "^8.1.0",
"eslint-plugin-svelte3": "^3.1.0",
"postcss": "^8.2.10",
"postcss-load-config": "^3.0.1",
"prettier": "~2.2.1",
"prettier-plugin-svelte": "^2.2.0",
"svelte": "^3.29.0",
"svelte-preprocess": "^4.7.1",
"tailwindcss": "^2.1.1",
"tslib": "^2.0.0",
"typescript": "^4.0.0",
"vite": "^2.1.0",
"autoprefixer": "^10.2.5",
"cssnano": "^5.0.1",
"postcss": "^8.2.10",
"postcss-load-config": "^3.0.1",
"tailwindcss": "^2.1.1"
"vite": "^2.1.0"
},
"type": "module"
}
6 changes: 4 additions & 2 deletions svelte.config.cjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const sveltePreprocess = require('svelte-preprocess')
const node = require('@sveltejs/adapter-node')
// const node = require('@sveltejs/adapter-node')
const vercel = require('@sveltejs/adapter-vercel');
const pkg = require('./package.json')

/** @type {import('@sveltejs/kit').Config} */
Expand All @@ -19,7 +20,8 @@ module.exports = {
// By default, `npm run build` will create a standard Node app.
// You can create optimized builds for different platforms by
// specifying a different adapter
adapter: node(),
// adapter: node(),
adapter: vercel(),

// hydrate the <div id="svelte"> element in src/app.html
target: '#svelte',
Expand Down

1 comment on commit 72d057c

@vercel
Copy link

@vercel vercel bot commented on 72d057c Apr 19, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.