diff --git a/application/Espo/Resources/metadata/app/client.json b/application/Espo/Resources/metadata/app/client.json index 4da8ad75c5..27e7882eee 100644 --- a/application/Espo/Resources/metadata/app/client.json +++ b/application/Espo/Resources/metadata/app/client.json @@ -4,6 +4,7 @@ ], "developerModeScriptList": [ "client/src/loader.js", + "client/src/loader-init-libs.js", "client/src/utils.js", "client/src/exceptions.js" ], diff --git a/client/cfg/libs.json b/client/cfg/libs.json deleted file mode 100644 index 793dda9282..0000000000 --- a/client/cfg/libs.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "espo": { - "exportsTo": "window", - "exportsAs": "Espo" - }, - "jquery": { - "exportsTo": "window", - "exportsAs": "$" - }, - "backbone": { - "exportsTo": "window", - "exportsAs": "Backbone" - }, - "bullbone": { - "exportsTo": "window", - "exportsAs": "Bull" - }, - "handlebars": { - "exportsTo": "window", - "exportsAs": "Handlebars" - }, - "underscore": { - "exportsTo": "window", - "exportsAs": "_" - }, - "marked": { - "exportsTo": "window", - "exportsAs": "marked" - }, - "dompurify": { - "exportsTo": "window", - "exportsAs": "DOMPurify" - } -} diff --git a/client/src/loader-init-libs.js b/client/src/loader-init-libs.js new file mode 100644 index 0000000000..8bf983bbdf --- /dev/null +++ b/client/src/loader-init-libs.js @@ -0,0 +1,64 @@ +/************************************************************************ + * This file is part of EspoCRM. + * + * EspoCRM - Open Source CRM application. + * Copyright (C) 2014-2021 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko + * Website: https://www.espocrm.com + * + * EspoCRM is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * EspoCRM is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with EspoCRM. If not, see http://www.gnu.org/licenses/. + * + * The interactive user interfaces in modified source and object code versions + * of this program must display Appropriate Legal Notices, as required under + * Section 5 of the GNU General Public License version 3. + * + * In accordance with Section 7(b) of the GNU General Public License version 3, + * these Appropriate Legal Notices must retain the display of the "EspoCRM" word. + ************************************************************************/ + +Espo.loader.addLibsConfig( + { + "espo": { + "exportsTo": "window", + "exportsAs": "Espo" + }, + "jquery": { + "exportsTo": "window", + "exportsAs": "$" + }, + "backbone": { + "exportsTo": "window", + "exportsAs": "Backbone" + }, + "bullbone": { + "exportsTo": "window", + "exportsAs": "Bull" + }, + "handlebars": { + "exportsTo": "window", + "exportsAs": "Handlebars" + }, + "underscore": { + "exportsTo": "window", + "exportsAs": "_" + }, + "marked": { + "exportsTo": "window", + "exportsAs": "marked" + }, + "dompurify": { + "exportsTo": "window", + "exportsAs": "DOMPurify" + } + } +); diff --git a/frontend/bundle-config.json b/frontend/bundle-config.json index c917b8c627..c7f8bcd227 100644 --- a/frontend/bundle-config.json +++ b/frontend/bundle-config.json @@ -3,6 +3,7 @@ "client/src/namespace.js", "client/src/exceptions.js", "client/src/loader.js", + "client/src/loader-init-libs.js", "client/src/utils.js", "client/src/acl.js", @@ -33,6 +34,8 @@ "client/src/view-helper.js", "client/src/page-title.js", "client/src/broadcast-channel.js", + "client/src/web-socket-manager.js", + "client/src/number.js", "client/src/app.js" ] diff --git a/html/main.html b/html/main.html index fd9e865993..1763352146 100644 --- a/html/main.html +++ b/html/main.html @@ -21,23 +21,19 @@ Espo.loader.setBasePath('{{basePath}}'); Espo.loader.setInternalModuleList({{internalModuleList}}); - Espo.loader - .loadLibsConfig('{{libsConfigPath}}') - .then(() => - require('{{appClientClassName}}', App => { - new App({ - id: '{{applicationId}}', - useCache: {{useCache}}, - cacheTimestamp: {{cacheTimestamp}}, - basePath: '{{basePath}}', - apiUrl: '{{apiUrl}}', - ajaxTimeout: {{ajaxTimeout}}, - internalModuleList: {{internalModuleList}}, - }, app => { - {{runScript}} - }); - }) - ); + require('{{appClientClassName}}', App => { + new App({ + id: '{{applicationId}}', + useCache: {{useCache}}, + cacheTimestamp: {{cacheTimestamp}}, + basePath: '{{basePath}}', + apiUrl: '{{apiUrl}}', + ajaxTimeout: {{ajaxTimeout}}, + internalModuleList: {{internalModuleList}}, + }, app => { + {{runScript}} + }); + }); });