@@ -20,6 +20,7 @@ Simple Server-Side-Rendering plugin for Vue CLI (Work-in-Progress)
20
20
- Vuex store
21
21
- Async routes
22
22
- [ vue-cli-plugin-apollo] ( https://github.com/Akryum/vue-cli-plugin-apollo ) support
23
+ - Custom middlewares
23
24
24
25
<br >
25
26
@@ -41,3 +42,41 @@ To run the app in production:
41
42
yarn run ssr:build
42
43
yarn run ssr:start
43
44
```
45
+
46
+ ## Configuration
47
+
48
+ Here are the optional settings available in your ` vue.config.js ` file:
49
+
50
+ ``` js
51
+ const path = require (' path' )
52
+
53
+ module .exports = {
54
+ pluginOptions: {
55
+ ssr: {
56
+ // Listening port for `serve` command
57
+ port: null ,
58
+ // Listening host for `serve` command
59
+ host: null ,
60
+ // Entry for each target
61
+ entry : target => ` ./src/entry-${ target} ` ,
62
+ // Default title
63
+ defaultTitle: ' My app' ,
64
+ // Path to favicon
65
+ favicon: ' ./public/favicon.ico' ,
66
+ // Skip some requests from being server-side rendered
67
+ skipRequests : req => req .originalUrl === ' /graphql' ,
68
+ // See https://ssr.vuejs.org/guide/build-config.html#externals-caveats
69
+ nodeExternalsWhitelist: [/ \. css$ / , / \? vue&type=style/ ],
70
+ // Function to connect custom middlewares
71
+ extendServer : app => {
72
+ const cookieParser = require (' cookie-parser' )
73
+ app .use (cookieParser ())
74
+ },
75
+ // Paths
76
+ distPath: path .resolve (__dirname , ' ./dist' ),
77
+ templatePath: path .resolve (__dirname , ' ./dist/index.html' ),
78
+ serviceWorkerPath: path .resolve (__dirname , ' ./dist/service-worker.js' ),
79
+ }
80
+ }
81
+ }
82
+ ```
0 commit comments