@@ -10,7 +10,7 @@ import {
1010 Executable
1111} from '@rushstack/node-core-library' ;
1212import { Terminal , ConsoleTerminalProvider } from '@rushstack/terminal' ;
13- import { RushGlobalFolder } from '@microsoft/rush-lib/lib-esnext /api/RushGlobalFolder' ;
13+ import { RushGlobalFolder } from '@microsoft/rush-lib/lib/api/RushGlobalFolder' ;
1414import type { SpawnSyncReturns } from 'child_process' ;
1515import {
1616 RUSH_LIB_NAME ,
@@ -211,6 +211,20 @@ ${errorMessage}
211211 process . exit ( 1 ) ;
212212}
213213
214+ const exports : typeof import ( '@microsoft/rush-lib' ) = {
215+ /**
216+ * Used by the .js stubs for path-based imports of `@microsoft/rush-lib` internal APIs.
217+ */
218+ _rushSdk_loadInternalModule : ( srcImportPath : string ) => {
219+ if ( ! exports . _RushInternals ) {
220+ throw new Error (
221+ `Rush version ${ exports . Rush . version } does not support internal API imports via rush-sdk`
222+ ) ;
223+ }
224+ return exports . _RushInternals . loadModule ( srcImportPath ) ;
225+ }
226+ } as unknown as typeof import ( '@microsoft/rush-lib' ) ;
227+
214228// Based on TypeScript's __exportStar()
215229for ( const property in sdkContext . rushLibModule ) {
216230 if ( property !== 'default' && ! exports . hasOwnProperty ( property ) ) {
@@ -226,14 +240,4 @@ for (const property in sdkContext.rushLibModule) {
226240 }
227241}
228242
229- /**
230- * Used by the .js stubs for path-based imports of `@microsoft/rush-lib` internal APIs.
231- */
232- export function _rushSdk_loadInternalModule ( srcImportPath : string ) : unknown {
233- if ( ! exports . _RushInternals ) {
234- throw new Error (
235- `Rush version ${ exports . Rush . version } does not support internal API imports via rush-sdk`
236- ) ;
237- }
238- return exports . _RushInternals . loadModule ( srcImportPath ) ;
239- }
243+ export default exports ;
0 commit comments