Git Product home page Git Product logo

Comments (2)

zhangweixi avatar zhangweixi commented on August 11, 2024

发现是缓存造成的,可不可以刷新的时候都获取最新的呀,资源路径可以加随机数吗

from admin.

largezhou avatar largezhou commented on August 11, 2024

发现是缓存造成的,可不可以刷新的时候都获取最新的呀,资源路径可以加随机数吗

默认情况下,开发环境,生成的资源不会带哈希码,所以需要打开控制台的“disable cache”,才能看到刷新后的效果。

生产环境生成的资源都是带哈希码的,就不需要强制刷新。

在 vue.config.js 中适当位置加上 config.output.filename('[name].[hash].js').end()

建议不要这么做,开发 watch 时,会在目标目录生成无穷多的 js,,,

from admin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.