0
0
mirror of https://github.com/Maks1mS/free-ozon-dpr.git synced 2024-12-23 18:42:59 +03:00
free-ozon-dpr/vite.config.js

51 lines
979 B
JavaScript
Raw Normal View History

import webfontDownload from "vite-plugin-webfont-dl";
import { VitePluginRadar } from "vite-plugin-radar";
2024-06-13 20:57:21 +03:00
import htmlPlugin from "vite-plugin-html-config";
2024-06-08 20:54:54 +03:00
2024-06-13 20:57:21 +03:00
const metas = [];
const headScripts = [];
console.log(process.env.YANDEX_METRICA_ID)
2024-06-08 20:54:54 +03:00
if (process.env.YANDEX_VERIFICATION) {
metas.push({
2024-06-13 20:57:21 +03:00
name: "yandex-verification",
content: process.env.YANDEX_VERIFICATION,
});
}
if (process.env.YANDEX_METRICA_ID) {
headScripts.push(
`window.YANDEX_METRICA_ID=${process.env.YANDEX_METRICA_ID}`,
);
2024-06-08 20:54:54 +03:00
}
2024-06-13 20:57:21 +03:00
const PUBLIC_URL =
process.env.PUBLIC_URL || process.env.VERCEL_PROJECT_PRODUCTION_URL;
2024-06-08 21:09:51 +03:00
if (PUBLIC_URL) {
metas.push({
2024-06-13 20:57:21 +03:00
name: "og:url",
content: "https://" + PUBLIC_URL,
});
2024-06-08 21:09:51 +03:00
}
2024-06-05 14:56:19 +03:00
export default {
root: "src",
build: {
outDir: "../dist",
},
2024-06-05 14:56:19 +03:00
plugins: [
webfontDownload(),
VitePluginRadar({
2024-06-05 14:56:19 +03:00
metrica: {
id: process.env.YANDEX_METRICA_ID,
2024-06-05 14:56:19 +03:00
},
}),
2024-06-08 20:54:54 +03:00
htmlPlugin({
metas,
2024-06-13 20:57:21 +03:00
headScripts,
}),
2024-06-05 14:56:19 +03:00
],
};