1
0
mirror of https://github.com/TeamPiped/Piped.git synced 2024-12-15 06:40:28 +05:30
Piped/vite.config.js

79 lines
2.7 KiB
JavaScript
Raw Normal View History

2021-12-28 20:09:20 +05:30
import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";
2022-08-17 19:04:57 +05:30
import Unocss from "unocss/vite";
import legacy from "@vitejs/plugin-legacy";
2023-06-17 10:35:44 +05:30
import VueI18nPlugin from "@intlify/unplugin-vue-i18n/vite";
2021-12-28 20:29:58 +05:30
import { VitePWA } from "vite-plugin-pwa";
2021-12-28 20:09:20 +05:30
import path from "path";
import eslintPlugin from "vite-plugin-eslint";
2021-12-28 20:09:20 +05:30
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
vue(),
2022-08-17 19:04:57 +05:30
Unocss(),
2023-06-17 10:35:44 +05:30
VueI18nPlugin({
2021-12-28 20:09:20 +05:30
include: path.resolve(__dirname, "./src/locales/**"),
}),
legacy({
targets: ["defaults", "not IE 11"],
}),
2021-12-29 01:09:02 +05:30
VitePWA({
registerType: "autoUpdate",
workbox: {
globPatterns: ["**/*.{js,css,html,ico,svg,png}", "manifest.webmanifest"],
2023-01-26 05:51:38 +05:30
globIgnores: ["**/*-legacy-*.js"],
2022-01-13 12:00:23 +05:30
runtimeCaching: [
{
urlPattern: /https:\/\/[a-zA-Z./0-9_]*\.(?:otf|ttf)/i,
handler: "CacheFirst",
options: {
cacheName: "fonts-cache",
expiration: {
maxEntries: 10,
maxAgeSeconds: 60 * 60 * 24 * 365, // <== 365 days
},
cacheableResponse: {
statuses: [0, 200],
},
},
},
],
2021-12-29 01:09:02 +05:30
},
manifest: {
name: "Piped",
short_name: "Piped",
background_color: "#000000",
theme_color: "#fa4b4b",
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",
},
],
},
}),
eslintPlugin(),
2021-12-28 20:09:20 +05:30
],
resolve: {
alias: {
"@": path.resolve(__dirname, "./src"),
stream: "stream-browserify",
2021-12-28 20:09:20 +05:30
},
},
2021-12-29 00:24:28 +05:30
build: {
sourcemap: true,
2023-07-06 17:38:09 +05:30
cssMinify: "lightningcss",
2021-12-29 00:24:28 +05:30
},
2021-12-28 20:09:20 +05:30
});