File tree Expand file tree Collapse file tree 1 file changed +12
-8
lines changed Expand file tree Collapse file tree 1 file changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ import {
21
21
Identifier ,
22
22
Node ,
23
23
} from 'estree' ;
24
- import { TransformSourceDescription , OutputOptions } from 'rollup' ;
24
+ import { TransformSourceDescription } from 'rollup' ;
25
25
import { NamedDeclaration , DefaultDeclaration } from './parsing-utilities' ;
26
26
import { isESMFormat } from '../options' ;
27
27
import {
@@ -102,17 +102,21 @@ export default class ExportTransform extends Transform implements TransformInter
102
102
} ) ;
103
103
}
104
104
105
- public extern ( options : OutputOptions ) : string {
106
- let output = EXTERN_OVERVIEW ;
105
+ public extern ( ) : string {
106
+ if ( Array . from ( this . originalExports . keys ( ) ) . length > 0 ) {
107
+ let output = EXTERN_OVERVIEW ;
107
108
108
- for ( const key of this . originalExports . keys ( ) ) {
109
- const value : ExportDetails = this . originalExports . get ( key ) as ExportDetails ;
110
- if ( value . source !== null ) {
111
- output += `function ${ value . closureName } (){};\n` ;
109
+ for ( const key of this . originalExports . keys ( ) ) {
110
+ const value : ExportDetails = this . originalExports . get ( key ) as ExportDetails ;
111
+ if ( value . source !== null ) {
112
+ output += `function ${ value . closureName } (){};\n` ;
113
+ }
112
114
}
115
+
116
+ return output ;
113
117
}
114
118
115
- return output ;
119
+ return '' ;
116
120
}
117
121
118
122
/**
You can’t perform that action at this time.
0 commit comments