File tree 1 file changed +8
-6
lines changed
1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -255,6 +255,11 @@ function pitch(request) {
255
255
}
256
256
257
257
const result = ( function makeResult ( ) {
258
+ const defaultExport =
259
+ typeof options . defaultExport !== "undefined"
260
+ ? options . defaultExport
261
+ : false ;
262
+
258
263
if ( locals ) {
259
264
if ( namedExport ) {
260
265
const identifiers = Array . from (
@@ -281,11 +286,6 @@ function pitch(request) {
281
286
. map ( ( [ id , key ] ) => `${ id } as ${ JSON . stringify ( key ) } ` )
282
287
. join ( ", " ) } }`;
283
288
284
- const defaultExport =
285
- typeof options . defaultExport !== "undefined"
286
- ? options . defaultExport
287
- : false ;
288
-
289
289
return defaultExport
290
290
? `${ localsString } \n${ exportsString } \nexport default { ${ identifiers
291
291
. map ( ( [ id , key ] ) => `${ JSON . stringify ( key ) } : ${ id } ` )
@@ -297,7 +297,9 @@ function pitch(request) {
297
297
esModule ? "export default" : "module.exports = "
298
298
} ${ JSON . stringify ( locals ) } ;`;
299
299
} else if ( esModule ) {
300
- return "\nexport {};" ;
300
+ return defaultExport
301
+ ? "\nexport {};export default {};"
302
+ : "\nexport {};" ;
301
303
}
302
304
return "" ;
303
305
} ) ( ) ;
You can’t perform that action at this time.
0 commit comments