Skip to content

Commit fcdc36d

Browse files
author
Guillaume Chau
committed
docs: config
1 parent ccdd23c commit fcdc36d

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

README.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ Simple Server-Side-Rendering plugin for Vue CLI (Work-in-Progress)
2020
- Vuex store
2121
- Async routes
2222
- [vue-cli-plugin-apollo](https://github.com/Akryum/vue-cli-plugin-apollo) support
23+
- Custom middlewares
2324

2425
<br>
2526

@@ -41,3 +42,41 @@ To run the app in production:
4142
yarn run ssr:build
4243
yarn run ssr:start
4344
```
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

Comments
 (0)