Skip to content

Commit 07bd298

Browse files
feat(all): update to new loader apis to remove global System
1 parent 8787295 commit 07bd298

File tree

1 file changed

+11
-13
lines changed

1 file changed

+11
-13
lines changed

src/framework-configuration.js

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ export class FrameworkConfiguration {
7171
this.preTasks = [];
7272
this.postTasks = [];
7373
this.resourcesToLoad = {};
74-
this.preTask(() => System.normalize('aurelia-bootstrapper').then(bootstrapperName => this.bootstrapperName = bootstrapperName));
74+
this.preTask(() => this.bootstrapperName = aurelia.loader.normalizeSync('aurelia-bootstrapper'));
7575
this.postTask(() => loadResources(aurelia.container, this.resourcesToLoad, aurelia.resources));
7676
}
7777

@@ -202,14 +202,13 @@ export class FrameworkConfiguration {
202202

203203
this.plugin(plugin);
204204
this.preTask(() => {
205-
return System.normalize(name, this.bootstrapperName).then(normalizedName => {
206-
normalizedName = normalizedName.endsWith('.js') || normalizedName.endsWith('.ts')
207-
? normalizedName.substring(0, normalizedName.length - 3) : normalizedName;
205+
let normalizedName = this.aurelia.loader.normalizeSync(name, this.bootstrapperName);
206+
normalizedName = normalizedName.endsWith('.js') || normalizedName.endsWith('.ts')
207+
? normalizedName.substring(0, normalizedName.length - 3) : normalizedName;
208208

209-
plugin.moduleId = normalizedName;
210-
plugin.resourcesRelativeTo = normalizedName;
211-
System.map[name] = normalizedName;
212-
});
209+
plugin.moduleId = normalizedName;
210+
plugin.resourcesRelativeTo = normalizedName;
211+
this.aurelia.loader.map(name, normalizedName);
213212
});
214213

215214
return this;
@@ -269,11 +268,10 @@ export class FrameworkConfiguration {
269268
*/
270269
developmentLogging(): FrameworkConfiguration {
271270
this.preTask(() => {
272-
return System.normalize('aurelia-logging-console', this.bootstrapperName).then(name => {
273-
return this.aurelia.loader.loadModule(name).then(m => {
274-
TheLogManager.addAppender(new m.ConsoleAppender());
275-
TheLogManager.setLevel(TheLogManager.logLevel.debug);
276-
});
271+
let name = this.aurelia.loader.normalizeSync('aurelia-logging-console', this.bootstrapperName);
272+
return this.aurelia.loader.loadModule(name).then(m => {
273+
TheLogManager.addAppender(new m.ConsoleAppender());
274+
TheLogManager.setLevel(TheLogManager.logLevel.debug);
277275
});
278276
});
279277

0 commit comments

Comments
 (0)