File tree Expand file tree Collapse file tree 3 files changed +53
-5
lines changed
packages/start-nitro-v2-vite-plugin Expand file tree Collapse file tree 3 files changed +53
-5
lines changed Original file line number Diff line number Diff line change 1+ # Vite-Plugin-Nitro-2
2+
3+ This package moves Nitro into a Vite-Plugin to consolidate the API surface between Nitro v2 and v3.
4+
5+ ## Usage
6+
7+ This plugin will provide SolidStart with the needed Node.js runtime to run in the backend.
8+
9+ ``` ts
10+ import { defineConfig } from " vite" ;
11+ import { nitroV2Plugin } from " @solidjs/vite-plugin-nitro-2" ;
12+ import { solidStart } from " @solidjs/start/config" ;
13+
14+ export default defineConfig ({
15+ plugins: [solidStart (), nitroV2Plugin ()]
16+ });
17+ ```
18+
19+ Some features that previously were re-exported by SolidStart are available directly through this plugin now.
20+
21+ ### Example: Prerendering
22+
23+ ``` ts
24+ import { defineConfig } from " vite" ;
25+ import { nitroV2Plugin } from " @solidjs/vite-plugin-nitro-2" ;
26+ import { solidStart } from " @solidjs/start/config" ;
27+
28+ export default defineConfig ({
29+ plugins: [
30+ solidStart (),
31+ nitroV2Plugin ({
32+ prerender: {
33+ crawlinks: true
34+ }
35+ })
36+ ]
37+ });
38+ ```
Original file line number Diff line number Diff line change 11{
2- "name" : " @solidjs/start-nitro-v2-vite-plugin" ,
2+ "name" : " @solidjs/vite-plugin-nitro-2" ,
3+ "description" : " Nitro v2 plugin for development with SolidStart 2.0" ,
34 "version" : " 0.0.1" ,
45 "type" : " module" ,
56 "scripts" : {
6- "build" : " tsc"
7+ "build" : " tsc" ,
8+ "typecheck" : " tsc --noEmit"
79 },
810 "exports" : {
9- "." : " ./src/index.ts"
11+ "." : " ./src/index.ts" ,
12+ "types" : " ./dist/index.d.ts"
1013 },
1114 "publishConfig" : {
1215 "access" : " public" ,
1316 "exports" : {
14- "." : " ./dist/index.js"
17+ "." : " ./dist/index.js" ,
18+ "types" : " ./dist/index.d.ts"
1519 }
1620 },
1721 "dependencies" : {
18- "nitropack" : " ^2.11.10" ,
22+ "nitropack" : " ^2.11.10"
23+ },
24+ "devDependencies" : {
1925 "vite" : " ^7.1.10"
26+ },
27+ "peerDependencies" : {
28+ "vite" : " ^7"
2029 }
2130}
You can’t perform that action at this time.
0 commit comments