Skip to content

EspoCRM – Open Source CRM Application

do not use suppress amd in runtime

Yuri Kuznetsov2cea39b5a990
diff --git a/client/src/loader.js b/client/src/loader.js
index d4d4f898a9..bab05c453d 100644
--- a/client/src/loader.js
+++ b/client/src/loader.js
@@ -69,7 +69,6 @@
* @property {string|null} exportsAs
* @property {string} [url]
* @property {boolean} [useCache]
- * @property {boolean} [suppressAmd]
*/
/**
@@ -570,7 +569,6 @@
let dataType, type, path, exportsTo, exportsAs;
let realName = id;
- let suppressAmd = false;
if (id.indexOf('lib!') === 0) {
dataType = 'script';
@@ -601,14 +599,6 @@
type = 'amd';
}
- if (!isDefinedLib && id.slice(-3) === '.js') {
- suppressAmd = true;
- }
-
- if (exportsAs) {
- suppressAmd = true;
- }
-
if (path.indexOf(':') !== -1) {
console.error(`Not allowed path '${path}'.`);
@@ -698,7 +688,6 @@
errorCallback: errorCallback,
exportsAs: exportsAs,
exportsTo: exportsTo,
- suppressAmd: suppressAmd,
};
if (path in this._pathsBeingLoaded) {
@@ -736,19 +725,11 @@
const fullUrl = urlObj.toString();
- if (suppressAmd) {
- define.amd = false;
- }
-
if (type === 'amd') {
this._urlIdMap[fullUrl] = id;
}
this._addScript(fullUrl, () => {
- if (suppressAmd) {
- define.amd = true;
- }
-
let value;
if (type === 'amd') {