2023-02-22 20:15:37 +00:00
|
|
|
import { defineConfig } from "vitest/config";
|
2022-12-13 22:19:07 +00:00
|
|
|
import react from "@vitejs/plugin-react-swc";
|
2023-01-07 20:36:18 +00:00
|
|
|
import loadVersion from "vite-plugin-package-version";
|
2023-02-24 18:23:00 +00:00
|
|
|
import { VitePWA } from "vite-plugin-pwa";
|
2023-02-19 17:03:54 +00:00
|
|
|
import checker from "vite-plugin-checker";
|
2022-12-13 22:19:07 +00:00
|
|
|
import path from "path";
|
|
|
|
|
|
|
|
export default defineConfig({
|
2023-02-19 14:55:09 +00:00
|
|
|
plugins: [
|
|
|
|
react(),
|
2023-02-24 18:23:00 +00:00
|
|
|
VitePWA({
|
|
|
|
registerType: "autoUpdate",
|
|
|
|
injectRegister: "inline",
|
2023-02-24 19:12:20 +00:00
|
|
|
workbox: {
|
2023-02-24 20:45:14 +00:00
|
|
|
globIgnores: ["**ping.txt**"],
|
2023-02-24 18:23:00 +00:00
|
|
|
},
|
|
|
|
includeAssets: [
|
|
|
|
"favicon.ico",
|
|
|
|
"apple-touch-icon.png",
|
|
|
|
"safari-pinned-tab.svg",
|
|
|
|
],
|
|
|
|
manifest: {
|
|
|
|
name: "movie-web",
|
|
|
|
short_name: "movie-web",
|
|
|
|
description: "The place for your favourite movies & shows",
|
|
|
|
theme_color: "#120f1d",
|
|
|
|
background_color: "#120f1d",
|
|
|
|
display: "standalone",
|
|
|
|
start_url: "/",
|
|
|
|
icons: [
|
2023-02-24 21:20:35 +00:00
|
|
|
{
|
|
|
|
src: "android-chrome-192x192.png",
|
|
|
|
sizes: "192x192",
|
|
|
|
type: "image/png",
|
|
|
|
purpose: "any",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
src: "android-chrome-512x512.png",
|
|
|
|
sizes: "512x512",
|
|
|
|
type: "image/png",
|
|
|
|
purpose: "any",
|
|
|
|
},
|
2023-02-24 18:23:00 +00:00
|
|
|
{
|
|
|
|
src: "android-chrome-192x192.png",
|
|
|
|
sizes: "192x192",
|
|
|
|
type: "image/png",
|
2023-02-24 21:16:51 +00:00
|
|
|
purpose: "maskable",
|
2023-02-24 18:23:00 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
src: "android-chrome-512x512.png",
|
|
|
|
sizes: "512x512",
|
|
|
|
type: "image/png",
|
2023-02-24 21:16:51 +00:00
|
|
|
purpose: "maskable",
|
2023-02-24 18:23:00 +00:00
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
}),
|
2023-02-19 14:55:09 +00:00
|
|
|
loadVersion(),
|
|
|
|
checker({
|
|
|
|
typescript: true, // check typescript build errors in dev server
|
2023-02-19 17:03:54 +00:00
|
|
|
eslint: {
|
|
|
|
// check lint errors in dev server
|
|
|
|
lintCommand: "eslint --ext .tsx,.ts src",
|
|
|
|
dev: {
|
|
|
|
logLevel: ["error"],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}),
|
2023-02-19 14:55:09 +00:00
|
|
|
],
|
2022-12-13 22:19:07 +00:00
|
|
|
resolve: {
|
|
|
|
alias: {
|
2022-12-13 22:50:13 +00:00
|
|
|
"@": path.resolve(__dirname, "./src"),
|
2022-12-13 22:19:07 +00:00
|
|
|
},
|
|
|
|
},
|
2023-02-22 20:15:37 +00:00
|
|
|
|
|
|
|
test: {
|
|
|
|
environment: "jsdom",
|
|
|
|
},
|
2022-12-13 22:19:07 +00:00
|
|
|
});
|