File tree 2 files changed +9
-8
lines changed
2 files changed +9
-8
lines changed Original file line number Diff line number Diff line change 1
1
const path = require ( "path" ) ;
2
2
const vueLivePath = path . join ( __dirname , "./vueLiveWithLayout" ) ;
3
+
3
4
module . exports = function enhanceAppFiles ( ) {
4
5
const content = [
5
6
// import live with es6 so that it is compatible with both build and dev
6
7
'import Vue from "vue";' ,
8
+ // vuepress is compiled in both node and non-node models
9
+ // it needs a "global" variable to make buble work.
10
+ // one of its dependencies, buffer uses global to detect compat with browser
11
+ // it is missing in browsers, so we add it.
12
+ 'if (typeof window !== "undefined" && window.global === undefined) {' ,
13
+ " window.global = window;" ,
14
+ "}" ,
7
15
// and in order for the loading to happen after we assign the variable,
8
16
// we load vue-live as a require instead of an import
9
17
`Vue.component("VueLive", () => import(${ JSON . stringify ( vueLivePath ) } ))`
Original file line number Diff line number Diff line change 1
1
import layout from "vuepress-plugin-live/live-layout" ;
2
-
3
- // vuepress is compiled in both node and non-node models
4
- // it needs a "global" variable to make buble work.
5
- // it is missing in browsers, so we add it.
6
- if ( typeof window !== "undefined" && window . global === undefined ) {
7
- window . global = { } ;
8
- }
9
- const { VueLive } = require ( "vue-live" ) ;
2
+ import { VueLive } from "vue-live" ;
10
3
11
4
export default {
12
5
functional : true ,
You can’t perform that action at this time.
0 commit comments