Vite HMR API preview

类型签名:

async function preview(inlineConfig?: InlineConfig): Promise<PreviewServer>

示例用法:

const { preview } = require(vite)

;(async () => {
  const previewServer = await preview({
    // 任何有效的用户配置项,将加上 `mode` 和 `configFile`
    preview: {
      port: 8080,
      open: true
    }
  })

  previewServer.printUrls()
})()

作者:唐伯虎点蚊香,如若转载,请注明出处:https://www.web176.com/vite/23784.html

(0)
打赏 支付宝 支付宝 微信 微信
唐伯虎点蚊香的头像唐伯虎点蚊香
上一篇 2023年6月7日
下一篇 2023年6月7日

相关推荐

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注