ソースを参照

允许浏览器在源码变化时自动刷新

lifanagju_citu 6 ヶ月 前
コミット
14104d8b3a
2 ファイル変更2 行追加1 行削除
  1. 1 1
      index.html
  2. 1 0
      vite.config.mjs

+ 1 - 1
index.html

@@ -6,7 +6,7 @@
   <link rel="icon" href="/favicon.ico" />
   <meta http-equiv="pragma" content="no-cache" />
   <meta http-equiv="cache-control" content="no-cache, no-store, must-revalidate" />
-  <meta http-equiv="expires" content="0" />
+  <meta http-equiv="Expires" content="0" />
   <meta name="viewport" content="width=device-width, initial-scale=1.0" />
   <title>%VITE_APP_TITLE%</title>
 </head>

+ 1 - 0
vite.config.mjs

@@ -70,6 +70,7 @@ export default defineConfig({
         chunkFileNames: 'chunks/[name].[hash].js',
         entryFileNames: '[name].js',
       },
+      watch: true // 允许浏览器在源码变化时自动刷新
     },
   },
    // 配置静态资源处理