-
Notifications
You must be signed in to change notification settings - Fork 14
/
config.default.js
49 lines (45 loc) · 1.12 KB
/
config.default.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
'use strict';
module.exports = () => {
const config = {};
config.view = {
defaultViewEngine: 'vue',
mapping: {
'.js': 'vue',
},
};
/**
* vue view options
* @property {Object|Boolean} [cache] support LRU cache or custom cache(implement set and get method)
* - Boolean: default true, use LRU cache
* - Object: support set LRU or custom cache(implement set and get method)
* @property {Object} [renderOptions] @see https://ssr.vuejs.org/en/api.html#renderer-options
* @example property [cache]
* use default LRU cache:
* cache: true
* disable default LRU cache:
* cache: false
* use LRU cache and set LRU:
* cache:{
* max: 1000,
* maxAge: 1000 * 3600 * 24 * 7,
* }
* custom cache(implement set and get method):
* cache: {
* get: (key, cb) => {
* return ...;
* },
* set: (key, val) => {
* ...
* }
* }
*
*/
config.vue = {
cache: true,
// renderOptions: {
// template: `<!DOCTYPE html><html lang="en"><body><!--vue-ssr-outlet--></body></html>`,
// ......
// },
};
return config;
};