2021-10-12 20:27:25 +02:00
|
|
|
import legacy from "@vitejs/plugin-legacy";
|
|
|
|
import vue from "@vitejs/plugin-vue";
|
|
|
|
import { defineConfig } from "vite";
|
2022-06-05 17:43:25 +02:00
|
|
|
import visualizer from "rollup-plugin-visualizer";
|
|
|
|
import viteCompression from "vite-plugin-compression";
|
2023-06-29 00:50:55 +02:00
|
|
|
import commonjs from "vite-plugin-commonjs";
|
2021-06-24 15:42:03 +02:00
|
|
|
|
2021-10-12 20:27:25 +02:00
|
|
|
const postCssScss = require("postcss-scss");
|
|
|
|
const postcssRTLCSS = require("postcss-rtlcss");
|
2021-09-26 17:22:38 +02:00
|
|
|
|
2022-06-05 17:49:48 +02:00
|
|
|
const viteCompressionFilter = /\.(js|mjs|json|css|html|svg)$/i;
|
|
|
|
|
2021-06-24 15:42:03 +02:00
|
|
|
// https://vitejs.dev/config/
|
|
|
|
export default defineConfig({
|
2022-09-12 12:33:46 +02:00
|
|
|
server: {
|
|
|
|
port: 3000,
|
|
|
|
},
|
2022-06-28 15:55:05 +02:00
|
|
|
define: {
|
|
|
|
"FRONTEND_VERSION": JSON.stringify(process.env.npm_package_version),
|
2023-07-17 14:14:05 +02:00
|
|
|
"DEVCONTAINER": JSON.stringify(process.env.DEVCONTAINER),
|
|
|
|
"GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN": JSON.stringify(process.env.GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN),
|
|
|
|
"CODESPACE_NAME": JSON.stringify(process.env.CODESPACE_NAME),
|
2022-06-28 15:55:05 +02:00
|
|
|
},
|
2021-08-08 18:24:05 +02:00
|
|
|
plugins: [
|
2023-06-29 00:50:55 +02:00
|
|
|
commonjs(),
|
2021-08-08 18:24:05 +02:00
|
|
|
vue(),
|
|
|
|
legacy({
|
2022-06-15 13:02:55 +02:00
|
|
|
targets: [ "since 2015" ],
|
2022-06-05 17:43:25 +02:00
|
|
|
}),
|
|
|
|
visualizer({
|
|
|
|
filename: "tmp/dist-stats.html"
|
|
|
|
}),
|
|
|
|
viteCompression({
|
|
|
|
algorithm: "gzip",
|
2022-06-05 17:49:48 +02:00
|
|
|
filter: viteCompressionFilter,
|
2022-06-05 17:43:25 +02:00
|
|
|
}),
|
|
|
|
viteCompression({
|
|
|
|
algorithm: "brotliCompress",
|
2022-06-05 17:49:48 +02:00
|
|
|
filter: viteCompressionFilter,
|
2022-06-05 17:43:25 +02:00
|
|
|
}),
|
2021-09-26 17:22:38 +02:00
|
|
|
],
|
|
|
|
css: {
|
|
|
|
postcss: {
|
|
|
|
"parser": postCssScss,
|
|
|
|
"map": false,
|
2022-04-17 09:27:35 +02:00
|
|
|
"plugins": [ postcssRTLCSS ]
|
2021-09-26 17:22:38 +02:00
|
|
|
}
|
2021-10-12 20:27:25 +02:00
|
|
|
},
|
2022-06-05 17:43:25 +02:00
|
|
|
build: {
|
2023-06-29 00:50:55 +02:00
|
|
|
commonjsOptions: {
|
|
|
|
include: [ /.js$/ ],
|
|
|
|
},
|
2022-06-05 17:43:25 +02:00
|
|
|
rollupOptions: {
|
|
|
|
output: {
|
|
|
|
manualChunks(id, { getModuleInfo, getModuleIds }) {
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
}
|
2021-10-12 20:27:25 +02:00
|
|
|
});
|