Commit 1054fe6
authored
chore: update the docs (#2)
### TL;DR
Simplified the Vite configuration for srvx and added Vercel Edge Functions deployment support.
### What changed?
- Simplified the `vite.config.ts` example by removing the conditional `outDir` configuration
- Streamlined build scripts in `package.json` to use a single `build` command
- Renamed `preview` script to `start` for clarity
- Added support for Vercel Edge Functions deployment via a new `framework` option
- Updated the plugin architecture to use three separate plugins (dev server, client build, server build)
- Added documentation for the new Vercel deployment option
- Added a new example for Vercel Edge Functions deployment
- Improved code formatting and organization
### How to test?
1. Use the simplified configuration:
```js
export default defineConfig({
plugins: [
...srvx({
entry: './src/server.ts',
}),
],
})
```
2. Run the build with the updated scripts:
```bash
npm run build # Runs both client and server builds
npm run start # Starts the production server
```
3. For Vercel deployment, add the framework option:
```js
...srvx({
entry: './src/server.ts',
framework: 'vercel'
})
```
### Why make this change?
The changes simplify the configuration and build process, making it more intuitive for users. The addition of Vercel Edge Functions support expands deployment options, allowing developers to easily deploy srvx applications to Vercel's edge network. The restructured plugin architecture provides better separation of concerns and more flexibility for advanced use cases.1 parent ab12a8c commit 1054fe6
2 files changed
+219
-216
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
| 80 | + | |
84 | 81 | | |
85 | 82 | | |
86 | 83 | | |
87 | 84 | | |
88 | 85 | | |
89 | | - | |
| 86 | + | |
90 | 87 | | |
91 | 88 | | |
92 | 89 | | |
| |||
110 | 107 | | |
111 | 108 | | |
112 | 109 | | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
| 110 | + | |
| 111 | + | |
117 | 112 | | |
118 | 113 | | |
119 | 114 | | |
| |||
125 | 120 | | |
126 | 121 | | |
127 | 122 | | |
128 | | - | |
129 | | - | |
| 123 | + | |
| 124 | + | |
130 | 125 | | |
131 | 126 | | |
132 | 127 | | |
133 | 128 | | |
134 | | - | |
| 129 | + | |
135 | 130 | | |
136 | 131 | | |
137 | 132 | | |
| |||
152 | 147 | | |
153 | 148 | | |
154 | 149 | | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
155 | 155 | | |
156 | 156 | | |
157 | 157 | | |
| |||
164 | 164 | | |
165 | 165 | | |
166 | 166 | | |
167 | | - | |
| 167 | + | |
168 | 168 | | |
169 | 169 | | |
170 | 170 | | |
| |||
173 | 173 | | |
174 | 174 | | |
175 | 175 | | |
176 | | - | |
177 | | - | |
178 | | - | |
179 | 176 | | |
180 | 177 | | |
181 | 178 | | |
| |||
194 | 191 | | |
195 | 192 | | |
196 | 193 | | |
197 | | - | |
198 | | - | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
199 | 198 | | |
200 | 199 | | |
201 | | - | |
| 200 | + | |
202 | 201 | | |
203 | 202 | | |
204 | 203 | | |
205 | 204 | | |
206 | 205 | | |
207 | 206 | | |
208 | 207 | | |
209 | | - | |
| 208 | + | |
210 | 209 | | |
211 | 210 | | |
212 | | - | |
213 | | - | |
214 | | - | |
215 | 211 | | |
216 | 212 | | |
217 | | - | |
| 213 | + | |
| 214 | + | |
218 | 215 | | |
219 | 216 | | |
220 | 217 | | |
| |||
235 | 232 | | |
236 | 233 | | |
237 | 234 | | |
238 | | - | |
| 235 | + | |
239 | 236 | | |
240 | 237 | | |
| 238 | + | |
241 | 239 | | |
242 | | - | |
| 240 | + | |
243 | 241 | | |
244 | 242 | | |
245 | | - | |
| 243 | + | |
246 | 244 | | |
247 | 245 | | |
| 246 | + | |
248 | 247 | | |
249 | 248 | | |
250 | 249 | | |
| |||
254 | 253 | | |
255 | 254 | | |
256 | 255 | | |
257 | | - | |
| 256 | + | |
258 | 257 | | |
259 | | - | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
260 | 261 | | |
261 | | - | |
| 262 | + | |
262 | 263 | | |
263 | 264 | | |
264 | 265 | | |
265 | 266 | | |
266 | | - | |
| 267 | + | |
267 | 268 | | |
268 | 269 | | |
269 | 270 | | |
| |||
0 commit comments