2022-06-26 03:34:18 +00:00
|
|
|
import vue from "@vitejs/plugin-vue";
|
|
|
|
import vueJsx from "@vitejs/plugin-vue-jsx";
|
|
|
|
import { defineConfig } from "vite";
|
2022-06-26 20:22:22 +00:00
|
|
|
import { VitePWA } from "vite-plugin-pwa";
|
2022-06-26 03:34:18 +00:00
|
|
|
import tsconfigPaths from "vite-tsconfig-paths";
|
2022-06-26 20:22:22 +00:00
|
|
|
import projInfo from "./src/data/projInfo.json";
|
2022-06-26 03:34:18 +00:00
|
|
|
|
|
|
|
// https://vitejs.dev/config/
|
|
|
|
export default defineConfig({
|
2022-07-14 04:57:11 +00:00
|
|
|
base: "./",
|
|
|
|
build: {
|
|
|
|
rollupOptions: {
|
2022-07-26 20:37:38 +00:00
|
|
|
output: {
|
2022-07-14 04:57:11 +00:00
|
|
|
manualChunks(id) {
|
2022-07-26 20:37:38 +00:00
|
|
|
if (id.includes("node_modules")) {
|
|
|
|
return id.toString().split("node_modules/")[1].split("/")[0].toString();
|
|
|
|
}
|
|
|
|
}
|
2022-07-14 04:57:11 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
2022-07-15 06:58:23 +00:00
|
|
|
resolve: {
|
|
|
|
alias: {
|
2022-07-26 20:37:38 +00:00
|
|
|
vue: "vue/dist/vue.esm-bundler.js"
|
2022-07-15 06:58:23 +00:00
|
|
|
}
|
|
|
|
},
|
2022-06-26 03:34:18 +00:00
|
|
|
plugins: [
|
|
|
|
vue(),
|
|
|
|
vueJsx({
|
|
|
|
// options are passed on to @vue/babel-plugin-jsx
|
|
|
|
}),
|
2022-06-26 20:22:22 +00:00
|
|
|
tsconfigPaths(),
|
|
|
|
VitePWA({
|
|
|
|
includeAssets: ["Logo.svg", "favicon.ico", "robots.txt", "apple-touch-icon.png"],
|
|
|
|
manifest: {
|
|
|
|
name: projInfo.title,
|
|
|
|
short_name: projInfo.title,
|
|
|
|
description: projInfo.description,
|
|
|
|
theme_color: "#2E3440",
|
|
|
|
icons: [
|
|
|
|
{
|
|
|
|
src: "pwa-192x192.png",
|
|
|
|
sizes: "192x192",
|
|
|
|
type: "image/png"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
src: "pwa-512x512.png",
|
|
|
|
sizes: "512x512",
|
|
|
|
type: "image/png"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
src: "pwa-512x512.png",
|
|
|
|
sizes: "512x512",
|
|
|
|
type: "image/png",
|
|
|
|
purpose: "any maskable"
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
})
|
2022-07-08 01:30:19 +00:00
|
|
|
],
|
|
|
|
test: {
|
|
|
|
environment: "jsdom"
|
|
|
|
}
|
2022-06-26 03:34:18 +00:00
|
|
|
});
|