@@ -273,8 +273,14 @@ module.exports = function (content) {
273
273
if ( script ) {
274
274
if ( options . esModule ) {
275
275
output += script . src
276
- ? getImportForImport ( 'script' , script )
277
- : getImport ( 'script' , script ) + '\n'
276
+ ? (
277
+ getNamedExportForImport ( 'script' , script ) + '\n' +
278
+ getImportForImport ( 'script' , script )
279
+ )
280
+ : (
281
+ getNamedExport ( 'script' , script ) + '\n' +
282
+ getImport ( 'script' , script )
283
+ ) + '\n'
278
284
} else {
279
285
output +=
280
286
'var __vue_script__ = ' +
@@ -429,6 +435,7 @@ module.exports = function (content) {
429
435
' })\n'
430
436
output += '})()}\n'
431
437
}
438
+
432
439
// final export
433
440
if ( options . esModule ) {
434
441
output += '\nexport default Component.exports\n'
@@ -461,6 +468,13 @@ module.exports = function (content) {
461
468
)
462
469
}
463
470
471
+ function getNamedExport ( type , part , index , scoped ) {
472
+ return (
473
+ 'export * from ' +
474
+ getRequireString ( type , part , index , scoped )
475
+ )
476
+ }
477
+
464
478
function getRequireString ( type , part , index , scoped ) {
465
479
return loaderUtils . stringifyRequest (
466
480
loaderContext ,
@@ -486,6 +500,13 @@ module.exports = function (content) {
486
500
)
487
501
}
488
502
503
+ function getNamedExportForImport ( type , impt , scoped ) {
504
+ return (
505
+ 'export * from ' +
506
+ getRequireForImportString ( type , impt , scoped )
507
+ )
508
+ }
509
+
489
510
function getRequireForImportString ( type , impt , scoped ) {
490
511
return loaderUtils . stringifyRequest (
491
512
loaderContext ,
0 commit comments