2021-10-12 13:27:25 -05:00
|
|
|
import legacy from "@vitejs/plugin-legacy";
|
|
|
|
import vue from "@vitejs/plugin-vue";
|
|
|
|
import { defineConfig } from "vite";
|
2022-06-05 10:43:25 -05:00
|
|
|
import visualizer from "rollup-plugin-visualizer";
|
|
|
|
import viteCompression from "vite-plugin-compression";
|
2021-06-24 08:42:03 -05:00
|
|
|
|
2021-10-12 13:27:25 -05:00
|
|
|
const postCssScss = require("postcss-scss");
|
|
|
|
const postcssRTLCSS = require("postcss-rtlcss");
|
2021-09-26 10:22:38 -05:00
|
|
|
|
2022-06-05 10:49:48 -05:00
|
|
|
const viteCompressionFilter = /\.(js|mjs|json|css|html|svg)$/i;
|
|
|
|
|
2021-06-24 08:42:03 -05:00
|
|
|
// https://vitejs.dev/config/
|
|
|
|
export default defineConfig({
|
2021-08-08 11:24:05 -05:00
|
|
|
plugins: [
|
|
|
|
vue(),
|
|
|
|
legacy({
|
2022-04-17 02:27:35 -05:00
|
|
|
targets: [ "ie > 11" ],
|
|
|
|
additionalLegacyPolyfills: [ "regenerator-runtime/runtime" ]
|
2022-06-05 10:43:25 -05:00
|
|
|
}),
|
|
|
|
visualizer({
|
|
|
|
filename: "tmp/dist-stats.html"
|
|
|
|
}),
|
|
|
|
viteCompression({
|
|
|
|
algorithm: "gzip",
|
2022-06-05 10:49:48 -05:00
|
|
|
filter: viteCompressionFilter,
|
2022-06-05 10:43:25 -05:00
|
|
|
}),
|
|
|
|
viteCompression({
|
|
|
|
algorithm: "brotliCompress",
|
2022-06-05 10:49:48 -05:00
|
|
|
filter: viteCompressionFilter,
|
2022-06-05 10:43:25 -05:00
|
|
|
}),
|
2021-09-26 10:22:38 -05:00
|
|
|
],
|
|
|
|
css: {
|
|
|
|
postcss: {
|
|
|
|
"parser": postCssScss,
|
|
|
|
"map": false,
|
2022-04-17 02:27:35 -05:00
|
|
|
"plugins": [ postcssRTLCSS ]
|
2021-09-26 10:22:38 -05:00
|
|
|
}
|
2021-10-12 13:27:25 -05:00
|
|
|
},
|
2022-06-05 10:43:25 -05:00
|
|
|
build: {
|
|
|
|
rollupOptions: {
|
|
|
|
output: {
|
|
|
|
manualChunks(id, { getModuleInfo, getModuleIds }) {
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
}
|
2021-10-12 13:27:25 -05:00
|
|
|
});
|