esbuild-gjs is an ESBuild plugin for building applications for Gjs (GNOME JavaScript runtime). It transpiles Gjs modules, handles GResource files, and supports both ESM and CJS output formats. Version 1.3.0 is current, with a monthly release cadence. Unlike generic bundlers, it integrates tightly with Gjs's module system and GLib/GTK APIs. Notable features: automatic GResource bundling, TypeScript support out of the box, and compatibility with ESBuild's plugin ecosystem. It requires esbuild ^0.28.0 as a peer dependency. The plugin is actively maintained and ships TypeScript type definitions.
npm install esbuild-gjsNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Builds a Gjs application with ESBuild using the esbuild-gjs plugin. Configures entry point, output, and Gjs-specific options.
Upgrade ESBuild to ^0.28.0 or later.
Ensure all GResource XML files are in the correct paths and referenced properly.
Use format: 'esm' and target: 'gnome-42' or later.
Use 'GResourcePlugin' instead.
Bundle all GResource files into a single resource or use separate builds.
Run: npm install esbuild-gjs esbuild@^0.28.0. Ensure you are using ESM imports.
Use: import { gjsPlugin } from 'esbuild-gjs'; or import gjsPlugin from 'esbuild-gjs';Verify that the path in gjsPlugin({ gresource: '...' }) exists and is correct.