Skip to content

Commit 1264256

Browse files
authored
docs(solid-start): add netlify vite plugin example (#5575)
1 parent d6a4352 commit 1264256

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+3388
-107
lines changed

docs/start/config.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,10 @@
329329
{
330330
"label": "Cloudflare Vite Plugin",
331331
"to": "framework/solid/examples/start-basic-cloudflare"
332+
},
333+
{
334+
"label": "Cloudflare Vite Plugin",
335+
"to": "framework/solid/examples/start-basic-netlify"
332336
}
333337
]
334338
}

docs/start/framework/react/guide/hosting.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,9 @@ Add a `netlify.toml` file to your project root:
148148
[build]
149149
command = "vite build"
150150
publish = "dist/client"
151+
[dev]
152+
command = "vite dev"
153+
port = 3000
151154
```
152155

153156
Deploy your application using their one-click deployment process, and you're ready to go!

docs/start/framework/solid/guide/hosting.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,9 @@ Add a `netlify.toml` file to your project root:
142142
[build]
143143
command = "vite build"
144144
publish = "dist/client"
145+
[dev]
146+
command = "vite dev"
147+
port = 3000
145148
```
146149

147150
Deploy your application using their one-click deployment process, and you're ready to go!
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
node_modules
2+
.DS_Store
3+
.cache
4+
.env
5+
dist
6+
.wrangler
7+
8+
# Local Netlify folder
9+
.netlify
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
**/public
2+
pnpm-lock.yaml
3+
routeTree.gen.ts
4+
worker-configuration.d.ts
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"files.watcherExclude": {
3+
"**/routeTree.gen.ts": true
4+
},
5+
"search.exclude": {
6+
"**/routeTree.gen.ts": true
7+
},
8+
"files.readonlyInclude": {
9+
"**/routeTree.gen.ts": true
10+
}
11+
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Start Basic Netlify
2+
3+
## Getting Started
4+
5+
### Install the dependencies
6+
7+
```bash
8+
pnpm i
9+
```
10+
11+
### Start the development server
12+
13+
```bash
14+
pnpm dev
15+
```
16+
17+
### Build for Production
18+
19+
```bash
20+
pnpm build
21+
```
22+
23+
### Deploy to Netlify
24+
25+
```sh
26+
netlify deploy
27+
```
28+
29+
## Accessing bindings
30+
31+
You can access Cloudflare bindings in server functions by using importable `env`:
32+
33+
```ts
34+
import { env } from 'cloudflare:workers'
35+
```
36+
37+
See `src/routes/index.tsx` for an example.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[build]
2+
command = "vite build"
3+
publish = "dist/client"
4+
[dev]
5+
command = "vite dev"
6+
port = 3000
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"name": "tanstack-solid-start-example-basic-netlify",
3+
"private": true,
4+
"sideEffects": false,
5+
"type": "module",
6+
"scripts": {
7+
"dev": "vite dev",
8+
"build": "vite build && tsc --noEmit",
9+
"preview": "vite preview"
10+
},
11+
"dependencies": {
12+
"@tanstack/solid-router": "^1.133.20",
13+
"@tanstack/solid-router-devtools": "^1.133.20",
14+
"@tanstack/solid-start": "^1.133.20",
15+
"solid-js": "^1.9.5"
16+
},
17+
"devDependencies": {
18+
"@netlify/vite-plugin-tanstack-start": "^1.1.4",
19+
"@types/node": "^22.5.4",
20+
"vite-plugin-solid": "^2.11.10",
21+
"autoprefixer": "^10.4.20",
22+
"postcss": "^8.5.1",
23+
"tailwindcss": "^3.4.17",
24+
"typescript": "^5.7.2",
25+
"vite": "^7.1.7",
26+
"vite-tsconfig-paths": "^5.1.4",
27+
"wrangler": "^4.40.2"
28+
}
29+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
export default {
2+
plugins: {
3+
tailwindcss: {},
4+
autoprefixer: {},
5+
},
6+
}

0 commit comments

Comments
 (0)