Skip to content

Commit

Permalink
drop workaround for the now fixed github.com/evanw/esbuild/issues/1958
Browse files Browse the repository at this point in the history
Signed-off-by: António Meireles <antonio.meireles@reformi.st>
  • Loading branch information
AntonioMeireles committed Dec 15, 2022
1 parent bd00c3d commit 4073540
Showing 1 changed file with 2 additions and 14 deletions.
16 changes: 2 additions & 14 deletions esbuild.config.cjs
@@ -1,19 +1,7 @@
const fs = require('fs')
const fs = require('node:fs')

const esbuild = require('esbuild')

// XXX taken from https://github.com/evanw/esbuild/issues/619#issuecomment-751995294
// XXX `plugins: [makeAllPackagesExternalPlugin]` were supposed to be superceeded by
// XXX `external: ['./node_modules/*']` but...
// XXX ... we're blocked by what seems to be https://github.com/evanw/esbuild/issues/1958
const makeAllPackagesExternalPlugin = {
name: 'make-all-packages-external',
setup: (build) => {
const filter = /^[^./]|^\.[^./]|^\.\.[^/]/ // Must not start with "/" or "./" or "../"
build.onResolve({ filter }, (arguments_) => ({ external: true, path: arguments_.path }))
}
}

const catcher = (error) => {
console.error(error)
// eslint-disable-next-line unicorn/no-process-exit
Expand All @@ -34,7 +22,7 @@ const builder = (entryPoints, outdir = 'dist', platform = targets.Node) =>
sourcemap: true,
sourcesContent: false,
...(platform === targets.Node
? { plugins: [makeAllPackagesExternalPlugin], target: 'node14' }
? { packages: 'external', target: 'node14' }
: {
inject: ['src/ui/react-shim.ts'],
jsxFactory: 'h',
Expand Down

0 comments on commit 4073540

Please sign in to comment.