gen-esbuild.node.mjs 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. /**
  2. * Don't touch this file. It will be regenerated by theia build.
  3. * To customize the build process, change ./esbuild.mjs
  4. */
  5. import { nativeDependenciesPlugin, problemMatcherPlugin, sourceMapPathsPlugin } from '@theia/bundle-plugin';
  6. import { watch, loader, minify, sourcemap, join, __dirname } from './gen-esbuild.browser.mjs';
  7. import { copy } from 'esbuild-plugin-copy';
  8. import resolvePackagePath from 'resolve-package-path';
  9. /**
  10. * @type {Record<string, string>}
  11. */
  12. export const nativeBindings = {
  13. drivelist: 'drivelist/build/Release/drivelist.node'
  14. };
  15. /**
  16. * @type {import('esbuild').BuildOptions}
  17. */
  18. export const nodeOptions = {
  19. entryPoints: {
  20. 'main': './src-gen/backend/main',
  21. 'ipc-bootstrap': '@theia/core/lib/node/messaging/ipc-bootstrap',
  22. // VS Code extension support:
  23. 'plugin-host': '@theia/plugin-ext/lib/hosted/node/plugin-host',
  24. // Make sure the node-pty thread workers can be executed:
  25. 'worker/conoutSocketWorker': 'node-pty/lib/worker/conoutSocketWorker',
  26. 'conpty_console_list_agent': 'node-pty/lib/conpty_console_list_agent',
  27. 'backend-init-theia': '@theia/plugin-ext/lib/hosted/node/scanners/backend-init-theia',
  28. 'parcel-watcher': '@theia/filesystem/lib/node/parcel-watcher',
  29. 'plugin-vscode-init': '@theia/plugin-ext-vscode/lib/node/plugin-vscode-init',
  30. },
  31. assetNames: 'native/[name]',
  32. bundle: true,
  33. outdir: 'lib/backend',
  34. platform: 'node',
  35. mainFields: ['node', 'module', 'main'],
  36. external: ['electron'],
  37. loader,
  38. minify,
  39. sourcemap,
  40. plugins: [
  41. problemMatcherPlugin(watch, 'node'),
  42. nativeDependenciesPlugin({
  43. pty: true,
  44. ripgrep: true,
  45. trash: true,
  46. nativeBindings
  47. }),
  48. copy({
  49. assets: [
  50. {
  51. // copy shell integration scripts
  52. from: join(resolvePackagePath('@theia/terminal', __dirname), '..', 'src', 'node', 'shell-integrations', '**', '*'),
  53. to: join(__dirname, 'lib', 'backend', 'shell-integrations')
  54. },
  55. ]
  56. }),
  57. sourceMapPathsPlugin()
  58. ]
  59. };