SHA256
1
0
forked from pool/element-web

Accepting request 1008216 from devel:languages:nodejs

fix oom

OBS-URL: https://build.opensuse.org/request/show/1008216
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/element-web?expand=0&rev=21
This commit is contained in:
Richard Brown 2022-10-06 05:42:24 +00:00 committed by Git OBS Bridge
commit ab812019b6
3 changed files with 24 additions and 3 deletions

View File

@ -1,3 +1,12 @@
-------------------------------------------------------------------
Wed Oct 5 13:34:44 UTC 2022 - Dominik Heidler <dheidler@suse.de>
- Fix webpack oom: fix-webpack-oom.patch
-------------------------------------------------------------------
Fri Sep 30 16:52:19 UTC 2022 - Bruno Pitrus <brunopitrus@hotmail.com>
- Remove spurious BuildRequire on electron.
-------------------------------------------------------------------
Wed Sep 28 16:14:03 UTC 2022 - Dominik Heidler <dheidler@suse.de>

View File

@ -26,16 +26,15 @@ Source0: https://github.com/vector-im/element-web/archive/v%{version}.tar
Source1: npm-packages-offline-cache.tar.gz
Source2: jitsi_external_api.min.js
Source3: prepare.sh
BuildRequires: nodejs-electron
Patch0: fix-webpack-oom.patch
BuildRequires: yarn
ExcludeArch: %{ix86} %{arm}
BuildArch: noarch
%description
A glossy Matrix collaboration client - web files
%prep
%autosetup -n element-web-%{version}
%autosetup -n element-web-%{version} -p0
%build
echo 'yarn-offline-mirror "./npm-packages-offline-cache"' > .yarnrc
@ -73,6 +72,8 @@ install -Dm644 config.sample.json -t "%{buildroot}%{_sysconfdir}/webapps/element
%files
%license LICENSE
%dir %{_datadir}/webapps
%dir %{_sysconfdir}/webapps
%{_datadir}/webapps/element
%{_sysconfdir}/webapps/element

11
fix-webpack-oom.patch Normal file
View File

@ -0,0 +1,11 @@
--- package.json 2022-09-28 17:01:20.000000000 +0200
+++ package.json 2022-10-05 15:31:15.012971003 +0200
@@ -37,7 +37,7 @@
"build:res": "node scripts/copy-res.js",
"build:genfiles": "yarn build:res && yarn build:jitsi && yarn build:module_system",
"build:modernizr": "modernizr -c .modernizr.json -d src/vector/modernizr.js",
- "build:bundle": "webpack --progress --bail --mode production",
+ "build:bundle": "node --max_old_space_size=4000 --optimize_for_size $(which webpack) --progress --bail --mode production",
"build:bundle-stats": "webpack --progress --bail --mode production --json > webpack-stats.json",
"build:module_system": "tsc --project ./tsconfig.module_system.json && node ./lib/module_system/scripts/install.js",
"dist": "scripts/package.sh",