@edgeone/react-router 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -44
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# @edgeone/react-router
|
|
1
|
+
# @edgeone/react-router
|
|
2
2
|
|
|
3
3
|
EdgeOne adapter plugin for React Router - Automatically converts React Router build output to EdgeOne deployment format with zero configuration.
|
|
4
4
|
|
|
@@ -14,7 +14,7 @@ EdgeOne adapter plugin for React Router - Automatically converts React Router bu
|
|
|
14
14
|
## Installation
|
|
15
15
|
|
|
16
16
|
```bash
|
|
17
|
-
npm install @edgeone/react-router
|
|
17
|
+
npm install @edgeone/react-router --save-dev
|
|
18
18
|
```
|
|
19
19
|
|
|
20
20
|
## Quick Start
|
|
@@ -23,7 +23,7 @@ Add the plugin to `vite.config.ts`:
|
|
|
23
23
|
|
|
24
24
|
```typescript
|
|
25
25
|
import { reactRouter } from "@react-router/dev/vite";
|
|
26
|
-
import { edgeoneAdapter } from "@edgeone/react-router
|
|
26
|
+
import { edgeoneAdapter } from "@edgeone/react-router";
|
|
27
27
|
import { defineConfig } from "vite";
|
|
28
28
|
|
|
29
29
|
export default defineConfig({
|
|
@@ -93,30 +93,12 @@ export default {
|
|
|
93
93
|
|
|
94
94
|
### EdgeOne Platform
|
|
95
95
|
|
|
96
|
-
1. Upload `.edgeone` directory
|
|
97
|
-
2. Set static path: `.edgeone/assets`
|
|
98
|
-
3. Set server entry: `.edgeone/server-handler/index.mjs`
|
|
99
|
-
|
|
100
|
-
### Docker
|
|
101
|
-
|
|
102
|
-
```dockerfile
|
|
103
|
-
FROM node:18-alpine
|
|
104
|
-
WORKDIR /app
|
|
105
|
-
COPY .edgeone .edgeone
|
|
106
|
-
EXPOSE 9000
|
|
107
|
-
CMD ["node", ".edgeone/server-handler/index.mjs"]
|
|
108
|
-
```
|
|
109
|
-
|
|
110
|
-
### Static Hosting (CSR)
|
|
111
|
-
|
|
112
96
|
```bash
|
|
113
|
-
|
|
114
|
-
vercel --prod .edgeone/assets
|
|
115
|
-
|
|
116
|
-
# Netlify
|
|
117
|
-
netlify deploy --prod --dir=.edgeone/assets
|
|
97
|
+
edgeone pages deploy
|
|
118
98
|
```
|
|
119
99
|
|
|
100
|
+
Learn more about [EdgeOne CLI](https://pages.edgeone.ai/document/edgeone-cli).
|
|
101
|
+
|
|
120
102
|
## Build Process
|
|
121
103
|
|
|
122
104
|
The adapter uses esbuild to bundle the server with the following optimizations:
|
|
@@ -127,26 +109,6 @@ The adapter uses esbuild to bundle the server with the following optimizations:
|
|
|
127
109
|
- **External**: Node.js built-in modules only
|
|
128
110
|
- **Bundle size**: ~1.88 MB (includes React, React Router, and all dependencies)
|
|
129
111
|
|
|
130
|
-
## Troubleshooting
|
|
131
|
-
|
|
132
|
-
**Build fails**: Ensure `build/client` exists. Run `npm run build` first.
|
|
133
|
-
|
|
134
|
-
**Port in use**:
|
|
135
|
-
|
|
136
|
-
```bash
|
|
137
|
-
PORT=8080 node .edgeone/server-handler/index.mjs
|
|
138
|
-
```
|
|
139
|
-
|
|
140
|
-
**Missing routes**: Enable verbose logging:
|
|
141
|
-
|
|
142
|
-
```typescript
|
|
143
|
-
edgeoneAdapter({ verbose: true });
|
|
144
|
-
```
|
|
145
|
-
|
|
146
|
-
## Environment Variables
|
|
147
|
-
|
|
148
|
-
- `PORT` - Server port (default: 9000)
|
|
149
|
-
|
|
150
112
|
## Requirements
|
|
151
113
|
|
|
152
114
|
- Node.js >= 18.0.0
|