@@ -22,7 +22,7 @@ import {
22
22
Node ,
23
23
ClassDeclaration ,
24
24
} from 'estree' ;
25
- import { TransformSourceDescription , OutputChunk } from 'rollup' ;
25
+ import { TransformSourceDescription , RenderedChunk } from 'rollup' ;
26
26
import { NamedDeclaration , DefaultDeclaration } from './parsing-utilities' ;
27
27
import { isESMFormat } from '../options' ;
28
28
import {
@@ -49,22 +49,22 @@ export default class ExportTransform extends Transform implements TransformInter
49
49
* Before Closure Compiler is given a chance to look at the code, we need to
50
50
* find and store all export statements with their correct type
51
51
* @param code source to parse
52
- * @param id Rollup id reference to the source
52
+ * @param chunk Rollup chunk reference to the source
53
53
*/
54
- public async deriveFromInputSource ( code : string , id : string ) : Promise < void > {
54
+ public async deriveFromInputSource ( code : string , chunk : RenderedChunk ) : Promise < void > {
55
55
const context = this . context ;
56
56
let originalExports : ExportNameToClosureMapping = { } ;
57
57
const program = context . parse ( code , { ranges : true } ) ;
58
58
59
59
walk . simple ( program , {
60
60
ExportNamedDeclaration ( node : ExportNamedDeclaration ) {
61
- const namedDeclarationValues = NamedDeclaration ( context , id , node ) ;
61
+ const namedDeclarationValues = NamedDeclaration ( context , node ) ;
62
62
if ( namedDeclarationValues !== null ) {
63
63
originalExports = { ...originalExports , ...namedDeclarationValues } ;
64
64
}
65
65
} ,
66
66
ExportDefaultDeclaration ( node : ExportDefaultDeclaration ) {
67
- const defaultDeclarationValue = DefaultDeclaration ( context , id , node ) ;
67
+ const defaultDeclarationValue = DefaultDeclaration ( context , node ) ;
68
68
if ( defaultDeclarationValue !== null ) {
69
69
originalExports = { ...originalExports , ...defaultDeclarationValue } ;
70
70
}
@@ -92,11 +92,7 @@ export default class ExportTransform extends Transform implements TransformInter
92
92
* @param id Rollup id reference to the source
93
93
* @return modified input source with window scoped references.
94
94
*/
95
- public async preCompilation (
96
- code : string ,
97
- chunk : any ,
98
- id : string ,
99
- ) : Promise < TransformSourceDescription > {
95
+ public async preCompilation ( code : string ) : Promise < TransformSourceDescription > {
100
96
if ( this . outputOptions === null ) {
101
97
this . context . warn (
102
98
'Rollup Plugin Closure Compiler, OutputOptions not known before Closure Compiler invocation.' ,
@@ -127,11 +123,7 @@ export default class ExportTransform extends Transform implements TransformInter
127
123
* @param id Rollup identifier for the source
128
124
* @return Promise containing the repaired source
129
125
*/
130
- public async postCompilation (
131
- code : string ,
132
- chunk : OutputChunk ,
133
- id : string ,
134
- ) : Promise < TransformSourceDescription > {
126
+ public async postCompilation ( code : string ) : Promise < TransformSourceDescription > {
135
127
if ( this . outputOptions === null ) {
136
128
this . context . warn (
137
129
'Rollup Plugin Closure Compiler, OutputOptions not known before Closure Compiler invocation.' ,
0 commit comments