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