fix: production build for vite

This commit is contained in:
Myzel394 2023-02-21 16:05:23 +01:00
parent b033b8f46f
commit a39d1d6d20
No known key found for this signature in database
GPG Key ID: 79CC92F37B3E1A2B

View File

@ -6,6 +6,8 @@ import viteSvgr from "vite-plugin-svgr"
import {viteCommonjs} from "@originjs/vite-plugin-commonjs"
import react from "@vitejs/plugin-react"
const isProduction = process.env.NODE_ENV === "production"
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
@ -14,11 +16,11 @@ export default defineConfig({
viteSvgr(),
htmlPlugin({
metas: [
{
isProduction && {
"http-equiv": "Content-Security-Policy",
content: "upgrade-insecure-requests",
},
],
].filter(Boolean),
}),
],
resolve: {