forked from surmon-china/surmon.me
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vun.config.js
47 lines (43 loc) · 985 Bytes
/
vun.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
/**
* @file vuniversal config
* @module config/vuniversal
* @author Surmon <[email protected]>
*/
const deepmerge = require('deepmerge')
const { resolveConfig } = require('vite')
module.exports = {
clientEntry: './src/client.ts',
serverEntry: './src/server.ts',
prerender: {
fallback: false,
routes: [
'/service',
'/about',
'/job',
'/app',
]
},
async vite(target, mode) {
const viteConfig = await resolveConfig(mode)
if (target === 'client') {
return deepmerge(viteConfig, {
// ...
})
}
if (target === 'server') {
return deepmerge(viteConfig, {
rollupInputOptions: {
// MARK: IMPORTANT! FOR Node.js bound
external: [...viteConfig.optimizeDeps.include]
},
vueCompilerOptions: {
directiveTransforms: {
swiper(prop, node, context) {
return { props: [] }
}
}
}
})
}
}
}