This commit is contained in:
Yuri Kuznetsov
2023-06-23 11:16:07 +03:00
parent bac2240c0b
commit c287d0ff5a
3 changed files with 25 additions and 12 deletions

View File

@@ -152,11 +152,13 @@ module.exports = grunt => {
uglify: {
options: {
mangle: true,
sourceMap: true,
output: {
comments: /^!/,
},
beautify: false,
mangle: true,
compress: true
},
bundle: {
options: {

View File

@@ -348,10 +348,6 @@ class ClientManager
*/
private function getTranspiledModuleList(): array
{
if (!$this->isDeveloperMode()) {
return [];
}
$modules = array_values(array_filter(
$this->module->getList(),
fn ($item) => $this->module->get([$item, 'jsTranspiled'])
@@ -368,10 +364,6 @@ class ClientManager
*/
private function getBundledModuleList(): array
{
if (!$this->isDeveloperMode()) {
return [];
}
$modules = array_values(array_filter(
$this->module->getList(),
fn ($item) => $this->module->get([$item, 'bundled'])

View File

@@ -520,6 +520,23 @@
/**
* @private
* @param {string} id
* @return {string}
*/
_restoreId(id) {
if (!id.includes(':')) {
return id;
}
let [mod, part] = id.split(':');
return `modules/${mod}/${part}`;
}
/**
* @private
* @param {string} id
* @return {string}
*/
_normalizeId(id) {
if (id in this._aliasMap) {
@@ -680,14 +697,16 @@
return;
}
if (id in this._bundleMapping) {
let bundleName = this._bundleMapping[id];
let restoredId = this._restoreId(id);
if (restoredId in this._bundleMapping) {
let bundleName = this._bundleMapping[restoredId];
this._requireBundle(bundleName).then(() => {
let value = this._get(id);
if (typeof value === 'undefined') {
let msg = `Could not obtain module '${id}' from bundle '${bundleName}'.`;
let msg = `Could not obtain module '${restoredId}' from bundle '${bundleName}'.`;
console.error(msg);
throw new Error(msg);