forked from TelegramOrg/Telegram-web-k
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.ts
61 lines (58 loc) · 1.36 KB
/
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
import {defineConfig} from 'vite';
import solidPlugin from 'vite-plugin-solid';
import handlebars from 'vite-plugin-handlebars';
import basicSsl from '@vitejs/plugin-basic-ssl';
import {visualizer} from 'rollup-plugin-visualizer';
import autoprefixer from 'autoprefixer';
const handlebarsPlugin = handlebars({
context: {
title: 'Telegram Web',
description: 'Telegram is a cloud-based mobile and desktop messaging app with a focus on security and speed.',
url: 'https://web.telegram.org/k/',
origin: 'https://web.telegram.org/'
}
});
const USE_HTTPS = false;
const NO_MINIFY = false;
export default defineConfig({
plugins: [
solidPlugin(),
handlebarsPlugin as any,
USE_HTTPS ? basicSsl() : undefined,
visualizer({
gzipSize: true,
template: 'treemap'
})
].filter(Boolean),
server: {
port: 8080,
https: USE_HTTPS
},
base: '',
build: {
target: 'es2020',
sourcemap: true,
assetsDir: '',
copyPublicDir: false,
emptyOutDir: true,
minify: NO_MINIFY ? false : undefined
// rollupOptions: {
// input: {
// main: './index.html',
// sw: './src/index.service.ts'
// }
// }
// cssCodeSplit: true
},
worker: {
format: 'es'
},
css: {
devSourcemap: true,
postcss: {
plugins: [
autoprefixer({}) // add options if needed
]
}
}
});