请求头相关

2021/11/13

# Purpose

Purpose

  • 作用:预取机制
  • 触发方法:
<link rel="prefetch" href="/images/big.jpeg">
1
  • 支持的值:prefetch/preload
// vue.config.js
module.exports = {
  chainWebpack: config => {
    // 移除 prefetch 插件
    config.plugins.delete('prefetch')

    // 或者
    // 修改它的选项:
    config.plugin('prefetch').tap(options => {
      options[0].fileBlacklist = options[0].fileBlacklist || []
      options[0].fileBlacklist.push(/myasyncRoute(.)+?\.js$/)
      return options
    })
  }
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
上次更新: 9/17/2024