first commit
This commit is contained in:
45
frontend/vite.config.ts
Normal file
45
frontend/vite.config.ts
Normal file
@@ -0,0 +1,45 @@
|
||||
import {fileURLToPath, URL} from 'node:url';
|
||||
|
||||
import tailwindcss from '@tailwindcss/vite';
|
||||
import vue from '@vitejs/plugin-vue';
|
||||
import vueJsx from '@vitejs/plugin-vue-jsx';
|
||||
import {defineConfig} from 'vite';
|
||||
import vueDevTools from 'vite-plugin-vue-devtools';
|
||||
import {VitePWA} from "vite-plugin-pwa";
|
||||
|
||||
// https://vite.dev/config/
|
||||
export default defineConfig({
|
||||
plugins: [
|
||||
vue(),
|
||||
vueJsx(),
|
||||
vueDevTools(),
|
||||
tailwindcss(),
|
||||
VitePWA({
|
||||
registerType: 'autoUpdate',
|
||||
workbox: {
|
||||
runtimeCaching: [
|
||||
{
|
||||
urlPattern: /\/news\?/,
|
||||
handler: 'NetworkFirst',
|
||||
options: {
|
||||
cacheName: 'news-api',
|
||||
networkTimeoutSeconds: 3
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
})
|
||||
],
|
||||
build: {outDir: 'dist'},
|
||||
resolve: {
|
||||
alias: {
|
||||
'@': fileURLToPath(new URL('./src', import.meta.url)),
|
||||
},
|
||||
},
|
||||
server: {
|
||||
proxy: {
|
||||
'/news': 'http://localhost:8000',
|
||||
'/meta': 'http://localhost:8000'
|
||||
}
|
||||
},
|
||||
});
|
Reference in New Issue
Block a user