File tree Expand file tree Collapse file tree 2 files changed +17
-12
lines changed Expand file tree Collapse file tree 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) => (
127127 if ( ! node . moduleSpecifier || ! ts . isStringLiteral ( node . moduleSpecifier ) ) {
128128 return node ;
129129 }
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- }
140130
141131 const file = bindModuleToFile ( node . moduleSpecifier . text ) ;
142132 if ( ! file ) {
143133 return node ;
144134 }
145135 const fileLiteral = ts . createLiteral ( file ) ;
146136
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+
147152 const exportClause = ts . visitNode (
148153 node . exportClause ,
149154 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" ;
23import "@circular/b" ;
34import { A } from "@circular/a" ;
45
56const n : NoRuntimecodeHere = null as any ;
67
7- sum ( 2 , 3 ) ;
88subs ( 2 , 3 ) ;
99const a = new A ( "" ) ;
You can’t perform that action at this time.
0 commit comments