forked from Mosasauroidea/GazellePW
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.js
60 lines (56 loc) · 1.52 KB
/
vite.config.js
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
import { defineConfig } from 'vite'
import { pickBy } from 'lodash-es'
import preact from '@preact/preset-vite'
import mdx from '@mdx-js/rollup'
import hq from 'alias-hq'
import yaml from '@rollup/plugin-yaml'
import remarkGfm from 'remark-gfm'
import { remarkExtendedTable, extendedTableHandlers } from 'remark-extended-table'
import remarkRehype from 'remark-rehype'
export default defineConfig({
plugins: [
preact(),
mdx({
providerImportSource: '@mdx-js/react',
remarkPlugins: [remarkGfm, remarkExtendedTable, [remarkRehype, { handlers: { ...extendedTableHandlers } }]],
}),
yaml({
transform(data) {
return pickBy(data, (v, k) => k.startsWith('client.'))
},
}),
],
clearScreen: false,
resolve: {
alias: {
react: 'preact/compat',
'react-dom/test-utils': 'preact/test-utils',
'react-dom': 'preact/compat',
'react/jsx-runtime': 'preact/jsx-runtime',
...hq.get('rollup'),
},
},
server: {
host: '0.0.0.0',
port: 9002,
hmr: false /* tmp for refactor style */,
},
build: {
outDir: 'public',
emptyOutDir: false,
assetsDir: 'app',
manifest: true,
rollupOptions: {
input: [
'src/js/app/app.jsx',
'src/js/globalapp/index.js',
'src/js/pages/sitehistory/index.js',
'src/js/pages/upload/index.js',
'src/js/pages/imgupload/index.js',
'src/js/pages/torrents/index.js',
'src/js/pages/userEdit.js',
'src/js/pages/stats/index.jsx',
],
},
},
})