-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
Showing
33 changed files
with
799 additions
and
14,497 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,17 @@ | ||
# create-svelte | ||
# Sveltekit Demo application for Vercel Speed-insights | ||
|
||
Everything you need to build a Svelte project, powered by [`create-svelte`](https://github.com/sveltejs/kit/tree/master/packages/create-svelte). | ||
## Setup | ||
|
||
## Creating a project | ||
This application was created with the following commands: | ||
|
||
If you're seeing this, you've probably already done this step. Congrats! | ||
- `cd apps` | ||
- `pnpm create svelte@latest sveltekit` (answers: Skeleton project, JavaScript with JSDoc, no additional option) | ||
- `cd sveltekit` | ||
- add `src/+layout.js` to include `import { injectSpeedInsights } from '@vercel/speed-insights/sveltekit'; injectSpeedInsights();` | ||
- edit package.json to add `"@vercel/speed-insights": "workspace:*"` dependency and change `@sveltejs/adapter-auto` into `@sveltejs/adapter-vercel` | ||
- eddi `svelte.config.js` to change `@sveltejs/adapter-auto` into `@sveltejs/adapter-vercel` | ||
- `pnpm i` | ||
|
||
```bash | ||
# create a new project in the current directory | ||
npm create svelte@latest | ||
## Usage | ||
|
||
# create a new project in my-app | ||
npm create svelte@latest my-app | ||
``` | ||
|
||
## Developing | ||
|
||
Once you've created a project and installed dependencies with `npm install` (or `pnpm install` or `yarn`), start a development server: | ||
|
||
```bash | ||
npm run dev | ||
|
||
# or start the server and open the app in a new browser tab | ||
npm run dev -- --open | ||
``` | ||
|
||
## Building | ||
|
||
To create a production version of your app: | ||
|
||
```bash | ||
npm run build | ||
``` | ||
|
||
You can preview the production build with `npm run preview`. | ||
|
||
> To deploy your app, you may need to install an [adapter](https://kit.svelte.dev/docs/adapters) for your target environment. | ||
Start it with `cd apps/sveltekit` + `pnpm dev` and browse to [http://localhost:5173](http://localhost:5173) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import { injectSpeedInsights } from '@vercel/speed-insights/sveltekit'; | ||
|
||
injectSpeedInsights(); |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,59 +1,2 @@ | ||
<script> | ||
import Counter from './Counter.svelte'; | ||
import welcome from '$lib/images/svelte-welcome.webp'; | ||
import welcome_fallback from '$lib/images/svelte-welcome.png'; | ||
</script> | ||
|
||
<svelte:head> | ||
<title>Home</title> | ||
<meta name="description" content="Svelte demo app" /> | ||
</svelte:head> | ||
|
||
<section> | ||
<h1> | ||
<span class="welcome"> | ||
<picture> | ||
<source srcset={welcome} type="image/webp" /> | ||
<img src={welcome_fallback} alt="Welcome" /> | ||
</picture> | ||
</span> | ||
|
||
to your new<br />SvelteKit app | ||
</h1> | ||
|
||
<h2> | ||
try editing <strong>src/routes/+page.svelte</strong> | ||
</h2> | ||
|
||
<Counter /> | ||
</section> | ||
|
||
<style> | ||
section { | ||
display: flex; | ||
flex-direction: column; | ||
justify-content: center; | ||
align-items: center; | ||
flex: 0.6; | ||
} | ||
h1 { | ||
width: 100%; | ||
} | ||
.welcome { | ||
display: block; | ||
position: relative; | ||
width: 100%; | ||
height: 0; | ||
padding: 0 0 calc(100% * 495 / 2048) 0; | ||
} | ||
.welcome img { | ||
position: absolute; | ||
width: 100%; | ||
height: 100%; | ||
top: 0; | ||
display: block; | ||
} | ||
</style> | ||
<h1>Welcome to SvelteKit</h1> | ||
<p>Visit <a href="/bruno">this page</a> to know more...</p> |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
a39b547
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
speed-insights-nuxt – ./apps/nuxt
speed-insights-nuxt-git-main-vercel-analytics.vercel.app
speed-insights-nuxt-vercel-analytics.vercel.app
speed-insights-nuxt.vercel.app
a39b547
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
speed-insights-vue – ./apps/vue
speed-insights-vue.vercel.app
speed-insights-vue-vercel-analytics.vercel.app
speed-insights-vue-git-main-vercel-analytics.vercel.app
a39b547
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
speed-insights-remix – ./apps/remix
speed-insights-remix.vercel.app
speed-insights-remix-vercel-analytics.vercel.app
speed-insights-remix-git-main-vercel-analytics.vercel.app
a39b547
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
speed-insights-sveltekit – ./apps/sveltekit
speed-insights-sveltekit.vercel.app
speed-insights-sveltekit-vercel-analytics.vercel.app
speed-insights-sveltekit-git-main-vercel-analytics.vercel.app