Vue-cli: Prefetch links presents in html even if prefetch plugin deleted

Created on 26 Sep 2018  路  7Comments  路  Source: vuejs/vue-cli

Version

3.0.4

Node and OS info

Node 10.10.0 / yarn 1.9.4

Steps to reproduce

// Resulting VUE config
module.exports = {
  chainWebpack: (config) => {
    config.plugins.delete('prefetch');
  },
};

What is expected?

No any <link rel="prefetch" href="/js/XXX.js"> of async components in html head section.

What is actually happening?

Tags <link rel="prefetch" href="/js/XXX.js"> present in head.

Notes

This code disappears from the configuration (vue inspect):

new PreloadPlugin({
  rel: 'prefetch',
  include: 'asyncChunks'
}),

The strange thing is that even in the absence of a plugin in vue inspect, <link> tags still appear in html.

All 7 comments

In issue #979 described the config I applied the method to disable prefetch, but it didn't work.

I found my mistake. I used the third-party package features incorrectly.

may I ask which third-party package features did you use incorrectly? I am currently facing the same issue

may I ask which third-party package features did you use incorrectly? I am currently facing the same issue

I don't think I remember.

did you use server side rendering for you project?

@yangning10000, if this question to me, then Yes

@KleinMaximus yeah I use vue-cli-plugin-ssr. in createBundleRenderer, there seems to be a inject: false which suppose to control the behavior but nothing works. I'm so confused right now

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Benzenes picture Benzenes  路  3Comments

Gonzalo2683 picture Gonzalo2683  路  3Comments

JIANGYUJING1995 picture JIANGYUJING1995  路  3Comments

CodeApePro picture CodeApePro  路  3Comments

OmgImAlexis picture OmgImAlexis  路  3Comments