-
-
Notifications
You must be signed in to change notification settings - Fork 116
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: respect open-in-editor host option (#281)
- Loading branch information
1 parent
611af04
commit 5fd4a44
Showing
9 changed files
with
24 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,9 @@ | ||
import { openInEditor as _openInEditor, callViteServerAction } from '@vue/devtools-core' | ||
|
||
const getOpenInEditorHost = callViteServerAction<string>('get-open-in-editor-host') | ||
export const vueInspectorDetected = ref(false) | ||
|
||
export const openInEditor = async (file: string) => { | ||
const openInEditorHost = await getOpenInEditorHost() | ||
return openInEditorHost ? _openInEditor(file, openInEditorHost) : _openInEditor(file) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,11 @@ | ||
import { defineViteServerAction } from '@vue/devtools-core' | ||
import type { ResolvedConfig } from 'vite' | ||
|
||
export function getViteConfig(config: ResolvedConfig) { | ||
export function getViteConfig(config: ResolvedConfig, pluginOptions) { | ||
defineViteServerAction('get-vite-root', () => { | ||
return config.root | ||
}) | ||
defineViteServerAction('get-open-in-editor-host', () => { | ||
return pluginOptions.openInEditorHost | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters