feat: added pwa functionality to vite
This commit is contained in:
+14
-1
@@ -1,5 +1,6 @@
|
||||
import { defineConfig } from 'vitest/config'
|
||||
import react from '@vitejs/plugin-react';
|
||||
import { VitePWA } from 'vite-plugin-pwa';
|
||||
import { execSync } from 'node:child_process';
|
||||
import path from 'path';
|
||||
|
||||
@@ -11,7 +12,19 @@ try {
|
||||
}
|
||||
|
||||
export default defineConfig({
|
||||
plugins: [react()],
|
||||
plugins: [react(),
|
||||
VitePWA({
|
||||
registerType: 'autoUpdate',
|
||||
strategies: 'generateSW',
|
||||
devOptions: {
|
||||
enabled: true
|
||||
},
|
||||
workbox: {
|
||||
cleanupOutdatedCaches: true,
|
||||
sourcemap: true
|
||||
}
|
||||
})
|
||||
],
|
||||
define: {
|
||||
'process.env.COMMIT_HASH': JSON.stringify(hash),
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user