import * as path from 'path'; import { defineConfig } from 'vite'; import { VitePWA } from 'vite-plugin-pwa'; import vue from '@vitejs/plugin-vue'; // https://vitejs.dev/config/ export default defineConfig({ server: { port: 8080 }, plugins: [ vue(), VitePWA({ registerType: 'autoUpdate', strategies: 'injectManifest', srcDir: '.', filename: 'sw_scripts-combined.js', manifest: { // This is used for the app name. It doesn't include a space, because iOS complains if I recall correctly. // There is a name with spaces in the constants/app.js file for use internally. name: process.env.TIME_SAFARI_APP_TITLE || require('./package.json').name, short_name: process.env.TIME_SAFARI_APP_TITLE || require('./package.json').name, // 192x192 and 512x512 are important for Chrome to show that it's installable "icons":[ {"src":"./img/icons/android-chrome-192x192.png","sizes":"192x192","type":"image/png"}, {"src":"./img/icons/android-chrome-512x512.png","sizes":"512x512","type":"image/png"}, {"src":"./img/icons/android-chrome-maskable-192x192.png","sizes":"192x192","type":"image/png","purpose":"maskable"}, {"src":"./img/icons/android-chrome-maskable-512x512.png","sizes":"512x512","type":"image/png","purpose":"maskable"} ], share_target: { action: '/share-target', method: 'POST', enctype: 'multipart/form-data', params: { files: [ { name: 'photo', accept: ['image/*'], }, ], }, }, }, }), ], resolve: { alias: { '@': path.resolve(__dirname, './src'), buffer: path.resolve(__dirname, 'node_modules', 'buffer'), 'dexie-export-import/dist/import': 'dexie-export-import/dist/import/index.js', }, }, });