-
Notifications
You must be signed in to change notification settings - Fork 1
/
vite.config.ts
37 lines (36 loc) · 967 Bytes
/
vite.config.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import { defineConfig } from "vite";
import eslintPlugin from "vite-plugin-eslint";
import html from "@web/rollup-plugin-html";
import resolve from "@rollup/plugin-node-resolve";
import terser from "@rollup/plugin-terser";
import minifyHTML from "rollup-plugin-minify-html-literals";
import viteCompression from 'vite-plugin-compression';
export default defineConfig({
build: {
rollupOptions: {
plugins: [
html({
input: "index.html",
}),
resolve(),
// Minify HTML template literals
minifyHTML(),
// Minify JS
terser({
ecma: 2020,
module: true,
}),
],
preserveEntrySignatures: "strict",
},
},
plugins: [
eslintPlugin(),
viteCompression({
verbose: false,
filter: (fileName: string) => /\.(js|css|html|txt|xml|json|svg|ico|ttf|otf|eot)$/.test(fileName),
algorithm: 'brotliCompress',
ext: ".br"
}),
],
});