File tree Expand file tree Collapse file tree 3 files changed +7
-17
lines changed Expand file tree Collapse file tree 3 files changed +7
-17
lines changed Original file line number Diff line number Diff line change @@ -161,15 +161,11 @@ module.exports = function (content) {
161161 }
162162
163163 var exports =
164- '__vue_options__ = __vue_exports__ = ' +
165- '__vue_exports__ || { default: {}, __esModule: true }\n' +
164+ '__vue_options__ = __vue_exports__ = __vue_exports__ || {}\n' +
166165 // ES6 modules interop
167- 'if (__vue_options__.__esModule) {\n' +
168- ' __vue_options__ = __vue_options__.default\n' +
169- // Webpack 2 interop
170- '} else if (typeof __vue_options__.default === "object") {\n' +
171- ' __vue_options__ = __vue_options__.default\n' +
172- ' __vue_exports__.__esModule = true\n' +
166+ 'if (typeof __vue_exports__.default === "object") {\n' +
167+ ( isProduction ? '' : 'if (Object.keys(__vue_exports__).length > 1) console.error("[vue-loader]: named exports are not supported.")\n' ) +
168+ '__vue_options__ = __vue_exports__ = __vue_exports__.default\n' +
173169 '}\n' +
174170 // constructor export interop
175171 'if (typeof __vue_options__ === "function") {\n' +
@@ -230,15 +226,15 @@ module.exports = function (content) {
230226 '")}\n'
231227 }
232228 // final export
233- output += '\nmodule.exports = __vue_exports__ || __vue_options__ \n'
229+ output += '\nmodule.exports = __vue_exports__\n'
234230 } else {
235231 // inject-loader support
236232 output +=
237233 '\n/* dependency injection */\n' +
238234 'module.exports = function (injections) {\n' +
239235 ' __vue_exports__ = __vue_exports__(injections)\n' +
240236 exports +
241- ' return __vue_exports__ || __vue_options__ \n' +
237+ ' return __vue_exports__\n' +
242238 '}'
243239 }
244240
Original file line number Diff line number Diff line change 33</template >
44
55<script >
6- export function test () {
7- return ' hi'
8- }
9-
106export default {
117 data () {
128 return {
Original file line number Diff line number Diff line change @@ -79,8 +79,6 @@ describe('vue-loader', function () {
7979 test ( {
8080 entry : './test/fixtures/basic.vue'
8181 } , function ( window , module , rawModule ) {
82- // test named export
83- expect ( rawModule . test ( ) ) . to . equal ( 'hi' )
8482 assertRenderFn ( module , '<h2 class="red">{{msg}}</h2>' )
8583 expect ( module . data ( ) . msg ) . to . contain ( 'Hello from Component A!' )
8684 var style = window . document . querySelector ( 'style' ) . textContent
@@ -183,7 +181,7 @@ describe('vue-loader', function () {
183181 column : col
184182 } )
185183 expect ( pos . source . indexOf ( 'basic.vue' ) > - 1 )
186- expect ( pos . line ) . to . equal ( 13 )
184+ expect ( pos . line ) . to . equal ( 9 )
187185 done ( )
188186 } )
189187 } )
You can’t perform that action at this time.
0 commit comments