2024-06-08 20:18:09 +03:00
|
|
|
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-22 20:15:47 +03:00
|
|
|
import { viteStaticCopy } from "vite-plugin-static-copy";
|
2024-06-08 20:54:54 +03:00
|
|
|
|
2024-06-13 20:57:21 +03:00
|
|
|
const metas = [];
|
|
|
|
const headScripts = [];
|
|
|
|
|
2024-06-22 20:15:47 +03:00
|
|
|
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) {
|
2024-06-22 20:15:47 +03:00
|
|
|
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 {
|
2024-06-08 20:18:09 +03:00
|
|
|
root: "src",
|
|
|
|
build: {
|
|
|
|
outDir: "../dist",
|
|
|
|
},
|
2024-06-05 14:56:19 +03:00
|
|
|
plugins: [
|
|
|
|
webfontDownload(),
|
2024-06-08 20:18:09 +03:00
|
|
|
VitePluginRadar({
|
2024-06-05 14:56:19 +03:00
|
|
|
metrica: {
|
2024-06-08 20:18:09 +03:00
|
|
|
id: process.env.YANDEX_METRICA_ID,
|
2024-06-05 14:56:19 +03:00
|
|
|
},
|
2024-06-08 20:18:09 +03:00
|
|
|
}),
|
2024-06-08 20:54:54 +03:00
|
|
|
htmlPlugin({
|
|
|
|
metas,
|
2024-06-13 20:57:21 +03:00
|
|
|
headScripts,
|
|
|
|
}),
|
2024-06-22 20:15:47 +03:00
|
|
|
viteStaticCopy({
|
|
|
|
targets: [
|
|
|
|
{
|
|
|
|
src: "../merged-data.json",
|
|
|
|
dest: "",
|
|
|
|
},
|
|
|
|
],
|
|
|
|
}),
|
2024-06-05 14:56:19 +03:00
|
|
|
],
|
2024-06-08 20:18:09 +03:00
|
|
|
};
|