Skip to content
Permalink
Browse files

FIX: Alias modules that are required AND imported (#8315)

  • Loading branch information...
markvanlan committed Nov 8, 2019
1 parent 1998be3 commit 47e3e56905fc61a0872716fc4401e9e0956dc6ac
Showing with 3 additions and 3 deletions.
  1. +3 −3 app/assets/javascripts/discourse-loader.js
@@ -151,7 +151,7 @@ var define, requirejs;
}

Module.prototype.makeRequire = function() {
var name = this.name;
var name = transformForAliases(this.name);

return (
this._require ||
@@ -217,7 +217,7 @@ var define, requirejs;
}

function requireFrom(name, origin) {
name = checkForAlias(name);
name = transformForAliases(name);
var mod = EMBER_MODULES[name] || registry[name];
if (!mod) {
throw new Error(
@@ -231,7 +231,7 @@ var define, requirejs;
throw new Error("Could not find module " + name);
}

function checkForAlias(name) {
function transformForAliases(name) {
return ALIASES[name] ? ALIASES[name] : name;
}

0 comments on commit 47e3e56

Please sign in to comment.
You can’t perform that action at this time.