File tree Expand file tree Collapse file tree 3 files changed +17
-9
lines changed Expand file tree Collapse file tree 3 files changed +17
-9
lines changed Original file line number Diff line number Diff line change @@ -24,23 +24,26 @@ module.exports = {
24
24
nodeExternalsWhitelist: [/ \. css$ / , / \? vue&type=style/ ],
25
25
// Static files Cache-Control maxAge value
26
26
staticCacheTtl: 1000 * 60 * 60 * 24 * 30 ,
27
+ // Directives fallback
28
+ directives: {
29
+ // See 'Directive' chapter
30
+ },
31
+ lruCacheOptions: {
32
+ // See https://ssr.vuejs.org/guide/caching.html
33
+ },
27
34
// Function to connect custom middlewares
28
35
extendServer : app => {
29
36
const cookieParser = require (' cookie-parser' )
30
37
app .use (cookieParser ())
31
38
},
39
+ onError : error => {
40
+ // Send to error monitoring service
41
+ },
32
42
// Paths
33
43
distPath: path .resolve (__dirname , ' ./dist' ),
34
44
error500Html: null ,
35
45
templatePath: path .resolve (__dirname , ' ./dist/index.html' ),
36
46
serviceWorkerPath: path .resolve (__dirname , ' ./dist/service-worker.js' ),
37
- // Directives fallback
38
- directives: {
39
- // See 'Directive' chapter
40
- }
41
- lruCacheOptions: {
42
- // See https://ssr.vuejs.org/guide/caching.html
43
- },
44
47
}
45
48
}
46
49
}
Original file line number Diff line number Diff line change @@ -126,6 +126,10 @@ module.exports = (app, options) => {
126
126
? errorHtml = errorHtml . replace ( '<!--server-error-msg-->' , errorMessage )
127
127
: errorHtml += errorMessage
128
128
}
129
+
130
+ if ( config . onError ) {
131
+ config . onError ( err )
132
+ }
129
133
}
130
134
131
135
res . status ( 500 ) . send ( errorHtml )
Original file line number Diff line number Diff line change @@ -10,11 +10,12 @@ module.exports = {
10
10
nodeExternalsWhitelist : [ / \. c s s $ / , / \? v u e & t y p e = s t y l e / ] ,
11
11
extendServer : null ,
12
12
staticCacheTtl : 1000 * 60 * 60 * 24 * 30 ,
13
+ directives : { } ,
14
+ lruCacheOptions : { } ,
15
+ onError : null ,
13
16
// Paths
14
17
distPath : null ,
15
18
error500Html : null ,
16
19
templatePath : null ,
17
20
serviceWorkerPath : null ,
18
- directives : { } ,
19
- lruCacheOptions : { } ,
20
21
}
You can’t perform that action at this time.
0 commit comments