/** * Don't touch this file. It will be regenerated by theia build. * To customize the build process, change ./esbuild.mjs */ import { nativeDependenciesPlugin, problemMatcherPlugin, sourceMapPathsPlugin } from '@theia/bundle-plugin'; import { watch, loader, minify, sourcemap, join, __dirname } from './gen-esbuild.browser.mjs'; import { copy } from 'esbuild-plugin-copy'; import resolvePackagePath from 'resolve-package-path'; /** * @type {Record} */ export const nativeBindings = { drivelist: 'drivelist/build/Release/drivelist.node' }; /** * @type {import('esbuild').BuildOptions} */ export const nodeOptions = { entryPoints: { 'main': './src-gen/backend/main', 'ipc-bootstrap': '@theia/core/lib/node/messaging/ipc-bootstrap', // VS Code extension support: 'plugin-host': '@theia/plugin-ext/lib/hosted/node/plugin-host', // Make sure the node-pty thread workers can be executed: 'worker/conoutSocketWorker': 'node-pty/lib/worker/conoutSocketWorker', 'conpty_console_list_agent': 'node-pty/lib/conpty_console_list_agent', 'backend-init-theia': '@theia/plugin-ext/lib/hosted/node/scanners/backend-init-theia', 'parcel-watcher': '@theia/filesystem/lib/node/parcel-watcher', 'plugin-vscode-init': '@theia/plugin-ext-vscode/lib/node/plugin-vscode-init', }, assetNames: 'native/[name]', bundle: true, outdir: 'lib/backend', platform: 'node', mainFields: ['node', 'module', 'main'], external: ['electron'], loader, minify, sourcemap, plugins: [ problemMatcherPlugin(watch, 'node'), nativeDependenciesPlugin({ pty: true, ripgrep: true, trash: true, nativeBindings }), copy({ assets: [ { // copy shell integration scripts from: join(resolvePackagePath('@theia/terminal', __dirname), '..', 'src', 'node', 'shell-integrations', '**', '*'), to: join(__dirname, 'lib', 'backend', 'shell-integrations') }, ] }), sourceMapPathsPlugin() ] };