interval-timer/vite.config.ts

51 lines
1 KiB
TypeScript
Raw Permalink Normal View History

import { defineConfig } from 'vite';
import { VitePWA } from 'vite-plugin-pwa';
export default defineConfig({
base: "/",
build: {
sourcemap: true,
assetsDir: "code",
},
plugins: [
VitePWA({
registerType: "autoUpdate",
injectRegister: false,
manifest: false,
workbox: {
globDirectory: 'dist',
globPatterns: [
'**/*.{html,js,css,png,webp,jpg}'
],
runtimeCaching: [
{
urlPattern: /^https:\/\/unpkg\.com\/.*/i,
handler: 'CacheFirst',
options: {
cacheName: 'unpkg-libs-cache',
expiration: {
maxEntries: 10,
maxAgeSeconds: 60 * 60 * 24 * 365 // <== 365 days
},
cacheableResponse: {
statuses: [0, 200]
}
}
}
]
},
devOptions: {
enabled: true
}
})
],
server: {
watch: {
usePolling: true
}
2022-08-15 03:40:52 +00:00
},
test: {
environment: 'jsdom'
}
2022-08-15 03:40:52 +00:00
});