Skip to content

Commit 756bccc

Browse files
committed
fix: allow to run ssr by default
1 parent 7da0c6f commit 756bccc

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

chainWebpack.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,13 @@ const path = require("path");
22

33
module.exports = options => {
44
const layoutPath = options.layout || path.resolve(__dirname, "./layout.vue");
5+
const noSsrPath = options.noSsr
6+
? "vue-no-ssr"
7+
: path.resolve(__dirname, "./dummyComponent.js");
58
return function(config) {
69
config.resolve.alias
710
.set("vue$", "vue/dist/vue.esm.js")
8-
.set("vuepress-plugin-live/live-layout", layoutPath);
11+
.set("vuepress-plugin-live/live-layout", layoutPath)
12+
.set("vue-no-ssr", noSsrPath);
913
};
1014
};

docs/.vuepress/config.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ module.exports = {
1515
require("../../index"),
1616
{
1717
// uncomment next line to use a custom layout
18-
// layout: path.resolve(__dirname, "./components/custom-layout.vue")
18+
// layout: path.resolve(__dirname, "./components/custom-layout.vue"),
19+
noSsr: true
1920
}
2021
],
2122
[

dummyComponent.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
module.exports = {
2+
functional: true,
3+
render(h, context) {
4+
return context.children;
5+
}
6+
};

0 commit comments

Comments
 (0)