Commit 06cd7915 authored by Tristan Read's avatar Tristan Read 💬 Committed by Olena Horal-Koretska
Browse files

fix(build): adapt bundle and transpile for gitlab-lsp 8.107.0

- Mark Node built-ins crypto and node:diagnostics_channel as external in the
  browser esbuild bundle. gitlab-lsp 8.107.0 references these in out/common/index.js;
  they are not used at runtime in the browser (the LS runs in a separate worker).
- Remove p-queue and p-timeout from the integration-test ES->CJS transpile list;
  gitlab-lsp 8.107.0 no longer pulls them into node_modules.
parent c4bf2909
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -43,7 +43,7 @@ async function processModule(module) {
}

async function main() {
  const modules = ['@anycable/core', 'nanoevents', 'p-queue', 'p-timeout', 'uuid'];
  const modules = ['@anycable/core', 'nanoevents', 'uuid'];

  await Promise.all(modules.map(module => processModule(module)));
}
+5 −0
Original line number Diff line number Diff line
@@ -177,6 +177,11 @@ async function buildExtension(args = [], signal) {
      '--external:fs',
      // `graceful-fs` is a dependency of `enhanced-resolve`, used in the LS. The dependency is not needed, as the LS supplies our own fsClient, so we prevent it from being included in the bundle
      '--external:graceful-fs',
      // `crypto` and `node:diagnostics_channel` are Node built-ins referenced by the LS's
      // `out/common/index.js`. They aren't used at runtime in the browser (the LS runs in a
      // separate worker bundle), so we mark them external to keep the browser bundle building.
      '--external:crypto',
      '--external:node:diagnostics_channel',
      '--format=cjs',
      '--sourcemap',
      '--platform=browser',