Gin框架LoadHTMLGlob 有缓存

在用vue-element-admin时候, 发现把element-ui迁移cdn后,
打包后index.html依旧 还是依赖/static/js/chunk-elementUI.js. 打开一直提示找不到.
才发现 后台 go gin框架 引用的html 有缓存. 重启后搞定

<link rel=stylesheet href=https://unpkg.com/element-ui@2.15.9/lib/theme-chalk/index.css>
    <script src=https://unpkg.com/vue@2.6.11/dist/vue.min.js></script>
    <script src=https://unpkg.com/vue-router@3.3.4/dist/vue-router.min.js></script>
    <script src=https://unpkg.com/element-ui@2.15.9/lib/index.js></script>

vue.config.js 配置文件.
打包后 index.html一直有个 runtime.js找不到.
最后定位 是它问题 注释掉 后ok
// config.optimization.runtimeChunk('single')

vue.config.js 参考
https://github.com/PanJiaChen/vue-element-admin/blob/master/vue.config.js

评论