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. 'electron-main': './src-gen/backend/electron-main',
  23. // VS Code extension support:
  24. 'plugin-host': '@theia/plugin-ext/lib/hosted/node/plugin-host',
  25. // Make sure the node-pty thread workers can be executed:
  26. 'worker/conoutSocketWorker': 'node-pty/lib/worker/conoutSocketWorker',
  27. 'conpty_console_list_agent': 'node-pty/lib/conpty_console_list_agent',
  28. 'backend-init-theia': '@theia/plugin-ext/lib/hosted/node/scanners/backend-init-theia',
  29. 'parcel-watcher': '@theia/filesystem/lib/node/parcel-watcher',
  30. 'plugin-vscode-init': '@theia/plugin-ext-vscode/lib/node/plugin-vscode-init',
  31. },
  32. assetNames: 'native/[name]',
  33. bundle: true,
  34. outdir: 'lib/backend',
  35. platform: 'node',
  36. mainFields: ['node', 'module', 'main'],
  37. external: ['electron'],
  38. loader,
  39. minify,
  40. sourcemap,
  41. plugins: [
  42. problemMatcherPlugin(watch, 'node'),
  43. nativeDependenciesPlugin({
  44. pty: true,
  45. ripgrep: true,
  46. trash: true,
  47. nativeBindings
  48. }),
  49. copy({
  50. assets: [
  51. {
  52. // copy shell integration scripts
  53. from: join(resolvePackagePath('@theia/terminal', __dirname), '..', 'src', 'node', 'shell-integrations', '**', '*'),
  54. to: join(__dirname, 'lib', 'backend', 'shell-integrations')
  55. },
  56. ]
  57. }),
  58. sourceMapPathsPlugin()
  59. ]
  60. };