Server push links generator for vuepress.
npm add vuepress-plugin-server-push
// .vuepress/config.js
const path = require('path')
module.exports = {
plugins: [
['server-push', {
firebase: path.resolve('../firebase.json')
netlify: '_headers' // only file name
}]
]
}
- Generate netlify
_headers
file
vuepress-server-push dist --netlify
- Generate firebase server push headers link to
firebase.json
vuepress-server-push dist --firebase
- Using postbuild script
{
scripts: {
build: "vuepress build docs -d dist",
postbuild: "vuepress-server-push dist --netlify",
}
}