gen-esbuild.node.mjs 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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. // VS Code Dev-Container communication:
  28. 'dev-container-server': '@theia/dev-container/lib/dev-container-server/dev-container-server',
  29. 'backend-init-theia': '@theia/plugin-ext/lib/hosted/node/scanners/backend-init-theia',
  30. 'parcel-watcher': '@theia/filesystem/lib/node/parcel-watcher',
  31. 'plugin-vscode-init': '@theia/plugin-ext-vscode/lib/node/plugin-vscode-init',
  32. },
  33. assetNames: 'native/[name]',
  34. bundle: true,
  35. outdir: 'lib/backend',
  36. platform: 'node',
  37. mainFields: ['node', 'module', 'main'],
  38. external: ['electron'],
  39. loader,
  40. minify,
  41. sourcemap,
  42. plugins: [
  43. problemMatcherPlugin(watch, 'node'),
  44. nativeDependenciesPlugin({
  45. pty: true,
  46. ripgrep: true,
  47. trash: true,
  48. nativeBindings
  49. }),
  50. copy({
  51. assets: [
  52. {
  53. // copy shell integration scripts
  54. from: join(resolvePackagePath('@theia/terminal', __dirname), '..', 'src', 'node', 'shell-integrations', '**', '*'),
  55. to: join(__dirname, 'lib', 'backend', 'shell-integrations')
  56. },
  57. ]
  58. }),
  59. sourceMapPathsPlugin()
  60. ]
  61. };