Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -78,5 +78,6 @@ test/fixture/functions

.pnpm-store
.wrangler
.rolldown

CHANGELOG.md
1 change: 1 addition & 0 deletions examples/vite-devtools/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.rolldown
31 changes: 31 additions & 0 deletions examples/vite-devtools/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width,initial-scale=1" />
<title>Hello World</title>
<style>
body {
font-family:
system-ui,
-apple-system,
"Segoe UI",
Roboto,
"Helvetica Neue",
Arial;
display: flex;
align-items: center;
justify-content: center;
height: 100vh;
margin: 0;
background: #f7f7f7;
}
h1 {
color: #111;
}
</style>
</head>
<body>
<h1>Hello, world!</h1>
</body>
</html>
3 changes: 3 additions & 0 deletions examples/vite-devtools/nitro.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { defineConfig } from "nitro";

export default defineConfig({});
14 changes: 14 additions & 0 deletions examples/vite-devtools/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"type": "module",
"scripts": {
"build": "vite build",
"dev": "vite dev",
"preview": "vite preview"
},
"devDependencies": {
"@vitejs/devtools": "0.0.0-alpha.17",
"@vitejs/devtools-kit": "0.0.0-alpha.17",
"nitro": "latest",
"vite": "npm:rolldown-vite"
}
}
3 changes: 3 additions & 0 deletions examples/vite-devtools/server.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default ({ req }: { req: Request }) => {
console.log(`[${req.method}] ${req.url}`);
};
3 changes: 3 additions & 0 deletions examples/vite-devtools/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "nitro/tsconfig"
}
34 changes: 34 additions & 0 deletions examples/vite-devtools/vite.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/// <reference types="@vitejs/devtools-kit" />
import { defineConfig } from "vite";
import type { Plugin } from "vite";
import { nitro } from "nitro/vite";

// https://vite-devtools.netlify.app/guide/
import { DevTools } from "@vitejs/devtools";

export default defineConfig({
plugins: [DevTools(), nitro(), ExamplePlugin()],
build: {
rolldownOptions: {
debug: {}, // enable debug mode
},
},
});

// https://vite-devtools.netlify.app/kit/
function ExamplePlugin(): Plugin {
return {
name: "nitro:docs",
devtools: {
setup(ctx) {
ctx.docks.register({
id: "nitro:docs",
type: "iframe",
title: "Nitro",
icon: "https://v3.nitro.build/icon.svg",
url: "https://v3.nitro.build/docs/quick-start",
});
},
},
};
}
Loading
Loading