Skip to content

Commit

Permalink
Writes the module manager to the require function.
Browse files Browse the repository at this point in the history
  • Loading branch information
hediet committed Aug 24, 2023
1 parent 7c0dfb6 commit 1ff7dd1
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/core/configuration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ namespace AMDLoader {
define(id: 'string', callback: any): void;
define(dependencies: string[], callback: any): void;
define(callback: any): void;

moduleManager?: ModuleManager;
}

export interface IModuleConfiguration {
Expand Down
2 changes: 2 additions & 0 deletions src/core/moduleManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,8 @@ namespace AMDLoader {
this._buildInfoPath = [];
this._buildInfoDefineStack = [];
this._buildInfoDependencies = [];

this._requireFunc.moduleManager = this;
}

public reset(): ModuleManager {
Expand Down
1 change: 1 addition & 0 deletions src/loader.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ declare namespace AMDLoader {
define(id: 'string', callback: any): void;
define(dependencies: string[], callback: any): void;
define(callback: any): void;
moduleManager?: ModuleManager;
}
interface IModuleConfiguration {
[key: string]: any;
Expand Down
1 change: 1 addition & 0 deletions src/loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -1248,6 +1248,7 @@ var AMDLoader;
this._buildInfoPath = [];
this._buildInfoDefineStack = [];
this._buildInfoDependencies = [];
this._requireFunc.moduleManager = this;
}
reset() {
return new ModuleManager(this._env, this._scriptLoader, this._defineFunc, this._requireFunc, this._loaderAvailableTimestamp);
Expand Down

0 comments on commit 1ff7dd1

Please sign in to comment.