Skip to content

Commit 2918925

Browse files
jbl2024Akryum
authored andcommitted
fix: component registration with meteor 1.8.2 (#380)
* fix: component registration with meteor 1.8.2 require behavior has changed in meteor 1.8.2 * Better case handling (thanks to jaumeMR)
1 parent df7e5eb commit 2918925

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

packages/vue-component/plugin/vue-compiler.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -678,8 +678,9 @@ function generateJs (vueId, inputFile, compileResult, isHotReload = false) {
678678
let isOutsideImports = inputFilePath.split('/').indexOf('imports') === -1
679679
if (isOutsideImports || isGlobalName) {
680680
// Component registration
681-
js += `\nvar _Vue = require('vue');
682-
_Vue.component(__vue_options__.name, __vue_script__);`
681+
js += `\nvar _Vue = require('vue').default;
682+
if (!_Vue) _Vue = require('vue');
683+
_Vue.component(__vue_options__.name, __vue_script__);\n`
683684
}
684685
}
685686

0 commit comments

Comments
 (0)