A progressive web app to display the angle bisector of two angles given by zodiac sign, degrees and minutes.
fork

Configure Feed

Select the types of activity you want to include in your feed.

at main 117 lines 4.1 kB view raw
1import { defineConfig, loadEnv } from "vite"; 2import { VitePWA } from "vite-plugin-pwa"; 3import fs from "fs"; 4import solid from "vite-plugin-solid"; 5 6// eslint-disable-next-line max-lines-per-function 7export default defineConfig(({ command, mode, isPreview }) => { 8 const env = loadEnv(mode, process.cwd()); 9 let pwaServerPath = env.VITE_PWA_SERVER_PATH; 10 // eslint-disable-next-line no-eq-null, eqeqeq 11 if (pwaServerPath == null) { 12 pwaServerPath = "/Bisectriz/"; 13 } 14 // eslint-disable-next-line no-console 15 console.log(`Setting server path to ${pwaServerPath}`); 16 17 if (command === "serve" || isPreview === true) { 18 return { 19 plugins: [ 20 solid(), 21 VitePWA({ 22 registerType: "autoUpdate", 23 manifest: false, 24 outDir: "http", 25 injectRegister: null, 26 includeManifestIcons: true, 27 injectManifest: { 28 injectionPoint: "VITE_PLUGIN_MANIFEST", 29 additionalManifestEntries: ["sw.js", "/"], 30 globPatterns: [ 31 "**/*.{js,css,html,ico,png,svg,xml,json,ttf}", 32 "icons/*.{png,svg}", 33 "assets/*.{js,css,html,ico,png,svg,xml,json}", 34 ], 35 }, 36 srcDir: "public", 37 filename: "sw.js", 38 strategies: "injectManifest", 39 devOptions: { 40 enabled: true, 41 }, 42 }), 43 ], 44 define: { 45 __APP_VERSION: JSON.stringify( 46 process.env.npm_package_version + 47 "-" + 48 Date.now().toString(), 49 ), 50 PWA_SERVER_PATH: JSON.stringify(pwaServerPath), 51 }, 52 server: { 53 host: "localhost", 54 https: { 55 key: fs.readFileSync("../localhost_https_cert-key.pem"), 56 cert: fs.readFileSync("../localhost_https_cert.pem"), 57 }, 58 }, 59 preview: { 60 port: 4173, 61 host: "localhost", 62 https: { 63 key: fs.readFileSync("../localhost_https_cert-key.pem"), 64 cert: fs.readFileSync("../localhost_https_cert.pem"), 65 }, 66 }, 67 base: "./", 68 build: { 69 sourcemap: true, 70 outDir: "./http", 71 emptyOutDir: true, 72 assetsDir: "./", 73 }, 74 }; 75 } 76 77 return { 78 plugins: [ 79 solid(), 80 VitePWA({ 81 registerType: "autoUpdate", 82 manifest: false, 83 outDir: "http", 84 injectRegister: null, 85 includeManifestIcons: true, 86 injectManifest: { 87 injectionPoint: "VITE_PLUGIN_MANIFEST", 88 additionalManifestEntries: ["sw.js", "/"], 89 globPatterns: [ 90 "**/*.{js,css,html,ico,png,svg,xml,json,ttf}", 91 "icons/*.{png,svg}", 92 "assets/*.{js,css,html,ico,png,svg,xml,json}", 93 ], 94 }, 95 srcDir: "public", 96 filename: "sw.js", 97 strategies: "injectManifest", 98 devOptions: { 99 enabled: true, 100 }, 101 }), 102 ], 103 define: { 104 __APP_VERSION: JSON.stringify( 105 process.env.npm_package_version + "-" + Date.now().toString(), 106 ), 107 PWA_SERVER_PATH: JSON.stringify(pwaServerPath), 108 }, 109 base: "./", 110 build: { 111 sourcemap: true, 112 outDir: "./http", 113 emptyOutDir: true, 114 assetsDir: "./", 115 }, 116 }; 117});