Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Vite plugin for generating `com.chrome.devtools.json` on the fly in the devserver.

License

NotificationsYou must be signed in to change notification settings

ChromeDevTools/vite-plugin-devtools-json

Repository files navigation

Vite plugin for generating the Chrome DevTools project settings file on-the-flyin the devserver.

This enables seamless integration with the new Chrome DevTools features

  1. DevTools Project Settings (devtools.json), and
  2. Automatic Workspace folders.

Installation

npm install -D vite-plugin-devtools-json

Usage

Add it to your Vite config

import{defineConfig}from'vite';importdevtoolsJsonfrom'vite-plugin-devtools-json';exportdefaultdefineConfig({plugins:[devtoolsJson(),// ...]});

While the plugin can generate a UUID and save it in vite cache, you can alsospecify it in the options like in the following:

  plugins: [    devtoolsJson({ uuid: "6ec0bd7f-11c0-43da-975e-2a8ad9ebae0b" }),    // ...  ]

Options

NameTypeDefaultDescription
projectRootstringconfig.rootAbsolute path that will be reported to DevTools. Useful for monorepos or when the Vite root is not the desired folder.
normalizeForWindowsContainerbooleantrueConvert Linux paths to UNC form so Chrome on Windows (WSL / Docker Desktop) can mount them (e.g. via WSL or Docker Desktop). Passfalse to disable.
Alias:normalizeForChrome (deprecated)_
uuidstringauto-generatedFixed UUID if you prefer to control it yourself.

Example with all options:

import{defineConfig}from'vite';importdevtoolsJsonfrom'vite-plugin-devtools-json';exportdefaultdefineConfig({plugins:[devtoolsJson({projectRoot:'/absolute/path/to/project',normalizeForWindowsContainer:true,uuid:'6ec0bd7f-11c0-43da-975e-2a8ad9ebae0b'})]});

The/.well-known/appspecific/com.chrome.devtools.json endpoint will serve theproject settings as JSON with the following structure

{"workspace": {"root":"/path/to/project/root","uuid":"6ec0bd7f-11c0-43da-975e-2a8ad9ebae0b"  }}

whereroot is the absolute path to your{projectRoot} folder, anduuid isa random v4 UUID, generated the first time that you start the Vite devserverwith the plugin installed (it is henceforth cached in the Vite cache folder).

Checkoutbmeurer/automatic-workspace-folders-vanilla for a trivial exampleproject illustrating how to use the plugin in practice.

Publishing

Googlers: We usego/wombat-dressing-roomfor publishing.

License

The code is underMIT License.

About

Vite plugin for generating `com.chrome.devtools.json` on the fly in the devserver.

Topics

Resources

License

Stars

Watchers

Forks


[8]ページ先頭

©2009-2025 Movatter.jp