vite.config.js 471 B

123456789101112131415161718
  1. import { defineConfig } from 'vite'
  2. import uni from '@dcloudio/vite-plugin-uni'
  3. export default defineConfig({
  4. plugins: [
  5. uni(),
  6. ],
  7. build: {
  8. // 添加时间戳到文件名,强制浏览器重新加载
  9. rollupOptions: {
  10. output: {
  11. entryFileNames: `assets/[name]-[hash]-${Date.now()}.js`,
  12. chunkFileNames: `assets/[name]-[hash]-${Date.now()}.js`,
  13. assetFileNames: `assets/[name]-[hash]-${Date.now()}.[ext]`
  14. }
  15. }
  16. }
  17. })