Skip to content

How to disable prefetch in vue-cli v4 #5562

Closed
@FrancescoMussi

Description

@FrancescoMussi

Version

4.3.1

Environment info

vue info doesn't seem to work in vue-cli v4

Steps to reproduce

I am trying to disable prefetch for webpack.
I am following the docs here:

https://cli.vuejs.org/guide/html-and-static-assets.html#prefetch

Deleting the prefetch plugin, in vue.config.js

chainWebpack: config => {
  config.plugins.delete('prefetch')
}

Or disabling it for each view in the router:

function loadView (view) {
  return () => import(
    /* webpackChunkName: "view-[request]" */
    /* webpackPrefetch: false */
    `@/views/${view}.vue`)
}

What is expected?

I expect not to load the views at startup

What is actually happening?

all views are actually loaded

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions