Skip to content

Latest commit

 

History

History
42 lines (37 loc) · 733 Bytes

README.md

File metadata and controls

42 lines (37 loc) · 733 Bytes

unplugin-dns-prefetch

Automatically collect the domain name in the code and insert it into the head of html

Usage

Vite

// vite.config.ts
import { defineConfig } from 'vite'
import dnsPrefetchPlugin from 'unplugin-prefetch-dns/vite'
import vue from '@vitejs/plugin-vue'
import type { PluginOption } from 'vite'
export default defineConfig({
  plugins: [
    vue(),
    dnsPrefetchPlugin(),
  ],
})

Webpack

// webpack.config.js
module.exports = {
  plugins: [
    require('unplugin-prefetch-dns/webpack').default,
  ],
}

Vue CLI

// vue.config.js
module.exports = {
  configureWebpack: {
    plugins: [
      require('unplugin-prefetch-dns/webpack').default
    ],
  },
}