-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.ts
52 lines (50 loc) · 1.27 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
import path from 'path'
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import tailwindcss from 'tailwindcss'
const root = path.resolve(__dirname, 'client')
export default defineConfig(({ mode }) => {
const isDev = mode === 'development'
return {
root,
appType: 'mpa',
plugins: [
vue(),
],
resolve: {
alias: {
'@': path.resolve(__dirname, 'client', 'src'),
'vue': 'vue/dist/vue.esm-browser.prod.js',
},
},
css: {
postcss: {
plugins: [tailwindcss({
config: path.resolve(__dirname, 'tailwind.config.cjs'),
})],
},
},
clearScreen: false,
optimizeDeps: {
include: ['monaco-editor', 'iframe-resizer/js/iframeResizer.contentWindow.min.js', '@hyper-function/hfz-global'],
},
build: {
// watch: isDev ? {} : undefined,
outDir: path.resolve(__dirname, 'dist', 'client'),
minify: !isDev,
manifest: !isDev,
emptyOutDir: !isDev,
reportCompressedSize: !isDev,
rollupOptions: {
input: {
index: `${root}/index.html`,
preview: `${root}/hfz-preview.html`,
previewEditor: `${root}/hfz-preview-editor.html`,
},
},
},
worker: {
format: 'es',
},
}
})