forked from vikejs/vike
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit a4f29c0
Showing
5 changed files
with
72 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
node_modules/ |
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,22 @@ | ||
{ | ||
"scripts": { | ||
"start:": "npm install && npm run build:vite-plugin-ssr && npm run start:server", | ||
"start:server": "ts-node-dev server.ts", | ||
"build:vite-plugin-ssr": "cd ../../ && npm run build" | ||
}, | ||
"dependencies": { | ||
"react": "^17.0.1", | ||
"react-dom": "^17.0.1" | ||
}, | ||
"devDependencies": { | ||
"@types/node": "^14.14.22", | ||
"@types/react": "^17.0.0", | ||
"@types/react-dom": "^17.0.0", | ||
"@vitejs/plugin-react-refresh": "^1.1.2", | ||
"express": "^4.17.1", | ||
"ts-node": "^9.1.1", | ||
"ts-node-dev": "^1.1.1", | ||
"typescript": "^4.1.3", | ||
"vite": "^2.0.0-beta.50" | ||
} | ||
} |
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,23 @@ | ||
import * as vite from "vite"; | ||
import * as express from "express"; | ||
|
||
startServer(); | ||
|
||
async function startServer() { | ||
const app = express(); | ||
|
||
const viteServer = await vite.createServer({ | ||
server: { | ||
middlewareMode: true, | ||
}, | ||
}); | ||
app.use(viteServer.middlewares); | ||
|
||
app.use("*", (_, res) => { | ||
res.send("hello"); | ||
}); | ||
|
||
const port = 3000; | ||
app.listen(port); | ||
console.log(`Server running at http://localhost:${port}`); | ||
} |
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,8 @@ | ||
{ | ||
"compilerOptions": { | ||
"strict": true, | ||
"lib": ["DOM"], | ||
"jsx": "react", | ||
"esModuleInterop": true | ||
} | ||
} |
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,18 @@ | ||
{ | ||
"workspaces": [ | ||
"src/" | ||
], | ||
"scripts": { | ||
"// Demo": "", | ||
"demo": "cd examples/vue/ && npm run start", | ||
"// Dev": "", | ||
"dev": "npm install && npm run build:watch", | ||
"// Build": "", | ||
"build": "npm install && npm run build:once", | ||
"build:once": "tsc --build", | ||
"build:watch": "tsc --build --watch" | ||
}, | ||
"devDependencies": { | ||
"typescript": "^4.1.3" | ||
} | ||
} |