diff --git a/README.md b/README.md index 7b8168a39e..3f0f12e0b8 100644 --- a/README.md +++ b/README.md @@ -44,21 +44,100 @@ export default defineNuxtConfig({ }) ``` +### Opting in to v4.0 + +Nuxt DevTools v4.0 is currently in alpha. Since Nuxt ships with a built-in version of DevTools, you can opt-in to v4.0 by using package manager resolutions to override the bundled version: + +
+npm + +```json +{ + "overrides": { + "@nuxt/devtools": "npm:@nuxt/devtools-nightly@latest" + } +} +``` + +
+ +
+yarn + +```json +{ + "resolutions": { + "@nuxt/devtools": "npm:@nuxt/devtools-nightly@latest" + } +} +``` + +
+ +
+pnpm + +```json +{ + "pnpm": { + "overrides": { + "@nuxt/devtools": "npm:@nuxt/devtools-nightly@latest" + } + } +} +``` + +
+ +Remove lockfile (`package-lock.json`, `yarn.lock`, or `pnpm-lock.yaml`) and reinstall dependencies. + ### Nightly Release Channel Similar to [Nuxt's Nightly Channel](https://nuxt.com/docs/guide/going-further/nightly-release-channel), DevTools also offers a nightly release channel, that automatically releases for every commit to `main` branch. -You can opt-in to the nightly release channel by running: +You can opt-in to the nightly release channel by using package manager resolutions: + +
+npm + +```json +{ + "overrides": { + "@nuxt/devtools": "npm:@nuxt/devtools-nightly@latest" + } +} +``` + +
+ +
+yarn + +```json +{ + "resolutions": { + "@nuxt/devtools": "npm:@nuxt/devtools-nightly@latest" + } +} +``` + +
-```diff +
+pnpm + +```json { - "devDependencies": { --- "@nuxt/devtools": "^0.1.0" -++ "@nuxt/devtools": "npm:@nuxt/devtools-nightly@latest" + "pnpm": { + "overrides": { + "@nuxt/devtools": "npm:@nuxt/devtools-nightly@latest" + } } } ``` +
+ Remove lockfile (`package-lock.json`, `yarn.lock`, or `pnpm-lock.yaml`) and reinstall dependencies. ### Module Options diff --git a/docs/content/1.guide/0.getting-started.md b/docs/content/1.guide/0.getting-started.md index bbf29f9a88..08eceff3b4 100644 --- a/docs/content/1.guide/0.getting-started.md +++ b/docs/content/1.guide/0.getting-started.md @@ -17,21 +17,78 @@ export default defineNuxtConfig({ Restart your Nuxt server and open your app in browser. Click the Nuxt icon on the bottom (or press :kbd{value="Shift"} + :kbd{value="Alt"} / :kbd{value="⇧ Shift"} + :kbd{value="⌥ Option"} + :kbd{value="D"}) to toggle the DevTools. +### Opting in to v4.0 + +Nuxt DevTools v4.0 is currently in alpha. Since Nuxt ships with a built-in version of DevTools, you can opt-in to v4.0 by using package manager resolutions to override the bundled version: + +::code-group + +```json [npm] +{ + "overrides": { + "@nuxt/devtools": "npm:@nuxt/devtools-nightly@latest" + } +} +``` + +```json [yarn] +{ + "resolutions": { + "@nuxt/devtools": "npm:@nuxt/devtools-nightly@latest" + } +} +``` + +```json [pnpm] +{ + "pnpm": { + "overrides": { + "@nuxt/devtools": "npm:@nuxt/devtools-nightly@latest" + } + } +} +``` + +:: + +Remove lockfile (`package-lock.json`, `yarn.lock`, or `pnpm-lock.yaml`) and reinstall dependencies. + ### Nightly Release Channel Similar to [Nuxt's Nightly Channel](https://nuxt.com/docs/guide/going-further/nightly-release-channel), DevTools also offers a nightly release channel, that automatically releases for every commit to `main` branch. -You can opt-in to the nightly release channel by running: +You can opt-in to the nightly release channel by using package manager resolutions: + +::code-group + +```json [npm] +{ + "overrides": { + "@nuxt/devtools": "npm:@nuxt/devtools-nightly@latest" + } +} +``` + +```json [yarn] +{ + "resolutions": { + "@nuxt/devtools": "npm:@nuxt/devtools-nightly@latest" + } +} +``` -```diff +```json [pnpm] { - "devDependencies": { --- "@nuxt/devtools": "^0.1.0" -++ "@nuxt/devtools": "npm:@nuxt/devtools-nightly@latest" + "pnpm": { + "overrides": { + "@nuxt/devtools": "npm:@nuxt/devtools-nightly@latest" + } } } ``` +:: + Remove lockfile (`package-lock.json`, `yarn.lock`, or `pnpm-lock.yaml`) and reinstall dependencies. ### Module Options