7
0

fix run with older nodejs

This commit is contained in:
2025-03-20 15:29:02 +01:00
parent af5b80a2f2
commit 5b943214b2
2 changed files with 9 additions and 2 deletions

View File

@@ -1,3 +1,8 @@
-------------------------------------------------------------------
Wed Feb 26 15:40:37 UTC 2025 - Darragh O'Reilly <doreilly@suse.com>
- fix await import error on older node.js versions
-------------------------------------------------------------------
Fri Feb 21 14:05:43 UTC 2025 - Adam Majer <adam.majer@suse.de>

View File

@@ -43,8 +43,10 @@ mkdir -p %{buildroot}%{_bindir}
cp -r dist node_modules %{buildroot}%{_datadir}/%{name}
cat > %{buildroot}%{_bindir}/local-npm-registry << EOF
#!/usr/bin/node
const foo = await import("%{_datadir}/%{name}/dist/index.js")
foo.mainEntryFunction()
(async () => {
const foo = await import("%{_datadir}/%{name}/dist/index.js");
foo.mainEntryFunction();
})();
EOF
%files