Skip to content

Commit 53deae6

Browse files
author
Nathan Reid
committed
mask module.exportDefault to prevent reload issues
1 parent 3f9db07 commit 53deae6

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

packages/vue-component/plugin/tag-handler.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,6 @@ VueComponentTagHandler = class VueComponentTagHandler {
114114
}
115115

116116
// Export
117-
script += `\nreturn require('${this.inputFile.getDisplayPath()}').default`
118117

119118
// Babel
120119
if (useBabel) {
@@ -180,7 +179,7 @@ VueComponentTagHandler = class VueComponentTagHandler {
180179
map.names = lastMap.names
181180
map.file = this.inputFile.getPathInPackage()
182181

183-
js += '__vue_script__ = (function(){ ' + script + '\n})()'
182+
js += 'module.exportDefault = function(value) { __vue_script__ = value; }; (function(){ if (!module.watch) {console.log(\'module\', module);} ' + script + '\n})();'
184183
}
185184

186185
// Template

0 commit comments

Comments
 (0)