{"id":22639,"library":"vite-plugin-devtools-json","title":"vite-plugin-devtools-json","description":"Vite plugin (v1.0.0) that generates the Chrome DevTools project settings file (com.chrome.devtools.json) on-the-fly in the dev server. It enables seamless integration with DevTools features like project settings and automatic workspace folders. The plugin serves a JSON endpoint at /.well-known/appspecific/com.chrome.devtools.json providing workspace root and UUID. Supports Vite 5, 6, and 7. Key differentiators: on-demand generation without build step, built-in UUID management, and Windows container path normalization for WSL/Docker Desktop. Written in TypeScript with type declarations.","status":"active","version":"1.0.0","language":"javascript","source_language":"en","source_url":"https://github.com/ChromeDevTools/vite-plugin-devtools-json","tags":["javascript","vite","vite-plugin","chrome-devtools","devtools","chrome","typescript"],"install":[{"cmd":"npm install vite-plugin-devtools-json","lang":"bash","label":"npm"},{"cmd":"yarn add vite-plugin-devtools-json","lang":"bash","label":"yarn"},{"cmd":"pnpm add vite-plugin-devtools-json","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Required as peer dependency; plugin only works with Vite 5, 6, or 7.","package":"vite","optional":false}],"imports":[{"note":"Default export; CommonJS require not supported as plugin ships ESM only.","wrong":"const devtoolsJson = require('vite-plugin-devtools-json')","symbol":"default","correct":"import devtoolsJson from 'vite-plugin-devtools-json'"},{"note":"Options type is exported; use 'import type' for compile-time only usage.","wrong":"import { VitePluginDevToolsOptions } from 'vite-plugin-devtools-json'","symbol":"type VitePluginDevToolsOptions","correct":"import type { VitePluginDevToolsOptions } from 'vite-plugin-devtools-json'"},{"note":"The function is the default export, not a named export.","wrong":"import { devtoolsJson } from 'vite-plugin-devtools-json'","symbol":"Plugin","correct":"import devtoolsJson from 'vite-plugin-devtools-json'; export default defineConfig({ plugins: [devtoolsJson()] })"}],"quickstart":{"code":"// vite.config.ts\nimport { defineConfig } from 'vite';\nimport devtoolsJson from 'vite-plugin-devtools-json';\n\nexport default defineConfig({\n  plugins: [\n    devtoolsJson({\n      uuid: '6ec0bd7f-11c0-43da-975e-2a8ad9ebae0b',\n      projectRoot: '/path/to/project',\n      normalizeForWindowsContainer: true\n    })\n  ]\n});","lang":"typescript","description":"Basic Vite config with all plugin options enabled and a fixed UUID."},"warnings":[{"fix":"Replace 'normalizeForChrome' with 'normalizeForWindowsContainer'.","message":"'normalizeForChrome' option is deprecated. Use 'normalizeForWindowsContainer' instead.","severity":"deprecated","affected_versions":">=1.0.0"},{"fix":"To persist UUID, pass a fixed uuid in options.","message":"The UUID is auto-generated on first dev server start and cached in Vite cache. Changing the cache will generate a new UUID.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Ensure Vite version is ^5.0.0 || ^6.0.0 || ^7.0.0.","message":"The plugin only works with Vite 5, 6, or 7. Older versions are not supported.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Use path.resolve(__dirname, '..') or an absolute path string.","message":"The projectRoot must be an absolute path. Relative paths will cause incorrect workspace root in DevTools.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Run 'npm install -D vite-plugin-devtools-json'","cause":"Package not installed or missing from node_modules.","error":"Cannot find module 'vite-plugin-devtools-json'"},{"fix":"Use 'import devtoolsJson from 'vite-plugin-devtools-json''","cause":"Using named import instead of default import.","error":"'devtoolsJson' is not a function"},{"fix":"Update Vite to ^5.0.0, ^6.0.0, or ^7.0.0","cause":"Installed Vite version mismatch.","error":"Plugin only works with Vite 5, 6, or 7"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}