Skip to content

Commit

Permalink
drop workaround over esbuild bug fixed upstream
Browse files Browse the repository at this point in the history
Signed-off-by: António Meireles <[email protected]>
  • Loading branch information
AntonioMeireles committed May 16, 2022
1 parent d450e66 commit c678f84
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions esbuild.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,6 @@ const fs = require('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' }
? { external: ['./node_modules/*'], target: 'node14' }
: {
inject: ['src/ui/react-shim.ts'],
jsxFactory: 'h',
Expand Down

0 comments on commit c678f84

Please sign in to comment.