Skip to content

Commit

Permalink
fix: open esm import
Browse files Browse the repository at this point in the history
  • Loading branch information
antfu committed May 23, 2023
1 parent 1a74fe1 commit b1e783c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
1 change: 1 addition & 0 deletions src/client/auto-imports.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ declare global {
const toReactive: typeof import('@vueuse/core')['toReactive']
const toRef: typeof import('vue')['toRef']
const toRefs: typeof import('vue')['toRefs']
const toValue: typeof import('vue')['toValue']
const triggerRef: typeof import('vue')['triggerRef']
const tryOnBeforeMount: typeof import('@vueuse/core')['tryOnBeforeMount']
const tryOnBeforeUnmount: typeof import('@vueuse/core')['tryOnBeforeUnmount']
Expand Down
9 changes: 4 additions & 5 deletions src/node/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { createServer } from 'node:http'
import type { AddressInfo } from 'node:net'
import fs from 'fs-extra'
import _debug from 'debug'
import open from 'open'
import type { Connect, Plugin, ResolvedConfig, ViteDevServer } from 'vite'
import type { ObjectHook } from 'rollup'
import sirv from 'sirv'
Expand Down Expand Up @@ -555,10 +554,10 @@ export default function PluginInspect(options: Options = {}): Plugin {
})
}

function openBrowser(address: string) {
open(address, {
newInstance: true,
}).catch(() => {})
async function openBrowser(address: string) {
await import('open')
.then(r => r.default(address, { newInstance: true }))
.catch(() => {})
}

const plugin = <Plugin>{
Expand Down

0 comments on commit b1e783c

Please sign in to comment.