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
2 changes: 1 addition & 1 deletion packages/core/src/client/webcomponents/.generated/css.ts

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion packages/core/src/node/context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,13 @@ export async function createDevToolsContext(
): Promise<DevToolsNodeContext> {
const cwd = viteConfig.root

const { searchForWorkspaceRoot } = await import('vite')
const { searchForWorkspaceRoot, version: viteVersion } = await import('vite')
const context: DevToolsNodeContext = {
cwd,
workspaceRoot: searchForWorkspaceRoot(cwd) ?? cwd,
viteConfig,
viteServer,
viteVersion,
mode: viteConfig.command === 'serve' ? 'dev' : 'build',
rpc: undefined!,
docks: undefined!,
Expand Down
4 changes: 4 additions & 0 deletions packages/kit/src/types/vite-plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ export interface DevToolsNodeContext {
* Vite dev server instance (only available in dev mode)
*/
readonly viteServer?: ViteDevServer
/**
* Vite version for the current runtime
*/
readonly viteVersion: string
/**
* RPC functions host, for registering server-side RPC functions and calling client-side RPC functions
*/
Expand Down
6 changes: 6 additions & 0 deletions packages/vite/src/app/pages/home.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ const metadata = computed(() => [
id: 'project',
icon: 'i-material-icon-theme:vite',
rows: [
{
id: 'version',
icon: 'i-system-uicons:version',
label: 'Version',
value: projectMetadata.value?.version,
},
{
id: 'root',
icon: 'i-ph-folder-duotone',
Expand Down
1 change: 1 addition & 0 deletions packages/vite/src/node/rpc/functions/vite-meta-info.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export const viteMetaInfo = defineRpcFunction({
return {
root,
base,
version: context.viteVersion,
plugins: plugins.map(p => p.name),
}
},
Expand Down
Loading