gnome-shell/js/dbusServices/dbus-service.in
Florian Müllner 612e04165e dbusServices: Port to ESM
We want to replace gjs' custom (and now legacy) imports system
with standard EcmaScript modules: JS developers are already
familiar with them, they have better tooling support and using
standard features over non-standard ones is generally the right
thing to do.

Our D-Bus services are separate from the main process, and thus
can be ported separately (except for the few imports that are
shared with the main process' code base).

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2786>
2023-06-21 13:26:42 +02:00

10 lines
285 B
Plaintext

import {programInvocationName, programArgs} from 'system';
imports.package.init({
name: '@PACKAGE_NAME@',
prefix: '@prefix@',
libdir: '@libdir@',
});
const {main} = await import(`${imports.package.moduledir}/main.js`);
await main([programInvocationName, ...programArgs]);