File tree 2 files changed +17
-12
lines changed
2 files changed +17
-12
lines changed Original file line number Diff line number Diff line change @@ -127,23 +127,28 @@ const transformer = (_: ts.Program) => (context: ts.TransformationContext) => (
127
127
if ( ! node . moduleSpecifier || ! ts . isStringLiteral ( node . moduleSpecifier ) ) {
128
128
return node ;
129
129
}
130
- if (
131
- ! node . exportClause &&
132
- ! compilerOptions . isolatedModules &&
133
- ! resolver . moduleExportsSomeValue ( node . moduleSpecifier )
134
- ) {
135
- return node ;
136
- }
137
- if ( node . exportClause && resolver . isValueAliasDeclaration ( node ) ) {
138
- return node ;
139
- }
140
130
141
131
const file = bindModuleToFile ( node . moduleSpecifier . text ) ;
142
132
if ( ! file ) {
143
133
return node ;
144
134
}
145
135
const fileLiteral = ts . createLiteral ( file ) ;
146
136
137
+ if (
138
+ ( ! node . exportClause &&
139
+ ! compilerOptions . isolatedModules &&
140
+ ! resolver . moduleExportsSomeValue ( node . moduleSpecifier ) ) ||
141
+ ( node . exportClause && resolver . isValueAliasDeclaration ( node ) )
142
+ ) {
143
+ return ts . updateExportDeclaration (
144
+ node ,
145
+ node . decorators ,
146
+ node . modifiers ,
147
+ node . exportClause ,
148
+ fileLiteral
149
+ ) ;
150
+ }
151
+
147
152
const exportClause = ts . visitNode (
148
153
node . exportClause ,
149
154
visitNamedExports as any ,
Original file line number Diff line number Diff line change 1
- import { subs , sum , NoRuntimecodeHere } from "@utils" ;
1
+ export { sum } from "@utils" ;
2
+ import { subs , NoRuntimecodeHere } from "@utils" ;
2
3
import "@circular/b" ;
3
4
import { A } from "@circular/a" ;
4
5
5
6
const n : NoRuntimecodeHere = null as any ;
6
7
7
- sum ( 2 , 3 ) ;
8
8
subs ( 2 , 3 ) ;
9
9
const a = new A ( "" ) ;
You can’t perform that action at this time.
0 commit comments