Skip to content

Commit a95f23c

Browse files
author
Barthelemy Ledoux
committed
fix: loading of external components
1 parent ffec821 commit a95f23c

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/enhanceAppFiles.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
11
const path = require("path");
2-
2+
const vueLivePath = path.join(__dirname, "./vueLiveWithLayout");
33
module.exports = function enhanceAppFiles() {
44
const content = [
55
// import live with es6 so that it is compatible with both build and dev
66
'import Vue from "vue";',
77
// and in order for the loading to happen after we assign the variable,
88
// we load vue-live as a require instead of an import
9-
`import VueLive from ${JSON.stringify(
10-
path.join(__dirname, "./vueLiveWithLayout")
11-
)};`,
12-
"Vue.component('vue-live', VueLive);"
9+
`Vue.component("VueLive", () => import(${JSON.stringify(vueLivePath)}))`
1310
].join("\n");
1411
return { name: "vue-live-enhancer", content };
1512
};

0 commit comments

Comments
 (0)