2024-09-11 18:29:31 +08:00
|
|
|
import { sveltekit } from '@sveltejs/kit/vite'
|
|
|
|
import { SvelteKitPWA as pwa } from '@vite-pwa/sveltekit'
|
|
|
|
// @ts-expect-error ts(7016)
|
|
|
|
import LightningCSS from 'postcss-lightningcss'
|
|
|
|
import TailwindCSS from 'tailwindcss'
|
|
|
|
import unoCSS from 'unocss/vite'
|
2022-07-08 10:35:36 +08:00
|
|
|
import { defineConfig } from 'vite'
|
2022-12-15 20:41:13 +08:00
|
|
|
import { imagetools } from 'vite-imagetools'
|
2024-09-11 18:29:31 +08:00
|
|
|
|
2022-07-08 10:35:36 +08:00
|
|
|
import tailwindConfig from './tailwind.config'
|
2024-09-11 18:29:31 +08:00
|
|
|
import unoConfig from './uno.config'
|
2022-07-08 10:35:36 +08:00
|
|
|
|
|
|
|
export default defineConfig({
|
|
|
|
css: {
|
|
|
|
postcss: {
|
2024-09-11 18:29:31 +08:00
|
|
|
plugins: [TailwindCSS(tailwindConfig), LightningCSS()],
|
|
|
|
},
|
2022-07-08 10:35:36 +08:00
|
|
|
},
|
2024-09-11 18:29:31 +08:00
|
|
|
envPrefix: 'URARA_',
|
2022-07-08 10:35:36 +08:00
|
|
|
plugins: [
|
2024-09-11 18:29:31 +08:00
|
|
|
unoCSS(unoConfig),
|
2022-12-15 20:41:13 +08:00
|
|
|
imagetools(),
|
2024-09-11 18:29:31 +08:00
|
|
|
sveltekit(),
|
|
|
|
pwa({
|
2022-11-08 15:43:07 +08:00
|
|
|
manifest: false,
|
2024-09-11 18:29:31 +08:00
|
|
|
registerType: 'autoUpdate',
|
2022-12-05 16:03:37 +08:00
|
|
|
scope: '/',
|
|
|
|
workbox: {
|
2024-09-11 18:29:31 +08:00
|
|
|
globIgnores: ['**/sw*', '**/workbox-*'],
|
2022-12-05 16:03:37 +08:00
|
|
|
globPatterns: ['posts.json', '**/*.{js,css,html,svg,ico,png,webp,avif}'],
|
2024-09-11 18:29:31 +08:00
|
|
|
},
|
|
|
|
}),
|
|
|
|
],
|
2022-07-08 10:35:36 +08:00
|
|
|
})
|