Skip to content

Commit 2642b99

Browse files
committed
fix: handle Nuxt devtools shipped native
1 parent 3ea388c commit 2642b99

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/commands/Devtools.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import {
88
projectRootDirectory,
99
getInstallationCommand,
1010
runCommand,
11+
getNuxtVersion,
1112
} from "../utils";
1213
import { updateDevtoolsStatusBar } from "../statusBar";
1314

@@ -144,8 +145,16 @@ async function nuxtConfigWatcher() {
144145

145146
async function nuxtDevToolsHandler() {
146147
const isInstalled = await isDevtoolsInstalled();
148+
let isDevtoolsNative = false;
147149

148-
if (!isInstalled) {
150+
let nuxtVersion = getNuxtVersion();
151+
if (typeof nuxtVersion === 'string') {
152+
isDevtoolsNative = nuxtVersion.startsWith('3.8') ? true : false;
153+
console.log('isDevtoolsNative', isDevtoolsNative);
154+
155+
}
156+
157+
if (!isInstalled && !isDevtoolsNative) {
149158
await installDevtools();
150159
updateDevtoolsStatusBar({
151160
command: "nuxtr.directUpgradeNuxt",

0 commit comments

Comments
 (0)