Skip to content

Commit f176266

Browse files
Ihor DykhtaIhor Dykhta
authored andcommitted
remove extra comments
Signed-off-by: Ihor Dykhta <ihordykhta@Ihors-MacBook-Pro.local>
1 parent 4230925 commit f176266

1 file changed

Lines changed: 3 additions & 26 deletions

File tree

examples/get-started/esbuild.config.mjs

Lines changed: 3 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,6 @@ const turfInteropPlugin = {
3434
}
3535
};
3636

37-
// @hubble.gl/react now ships proper ESM (no longer compiled with isNodeMode=1).
38-
// The old CJS shim for react-map-gl and @deck.gl/react is no longer needed and
39-
// was causing a double-init of luma.gl: the shim used require() which pulled in
40-
// the CJS chain (@deck.gl/core -> @luma.gl/* CJS) while kepler.gl ESM pulled in
41-
// the ESM luma.gl, resulting in two separate Luma class instances in the bundle.
42-
4337
const config = {
4438
platform: 'browser',
4539
format: 'iife',
@@ -61,31 +55,14 @@ const config = {
6155
'process.env.OpenAIToken': JSON.stringify(process.env.OpenAIToken || ''),
6256
'process.env.NODE_DEBUG': JSON.stringify(false)
6357
},
64-
// Force every @deck.gl/*, @luma.gl/* and @math.gl/* import — regardless of which
65-
// node_modules directory it is resolved from — to use the single copy installed in
66-
// this example's own node_modules. Without this, packages resolved from the monorepo
67-
// root (e.g. @deck.gl/mapbox) pull in the older root-level @deck.gl/core@9.3.1,
68-
// triggering the "multiple versions detected" warning and the luma.gl double-init
69-
// WebGL-debug-mode penalty.
70-
//
71-
// Note: esbuild's `alias` option does raw string substitution and does NOT consult
72-
// the target package's `exports` field for subpath resolution, so it cannot be used
73-
// here (e.g. `@luma.gl/webgl/constants` → `<dir>/constants` fails). Instead we use
74-
// an esbuild resolver plugin that re-resolves the specifier from __dirname so that
75-
// Node resolution always picks up the local node_modules copy.
58+
// Re-resolve @deck.gl/*, @luma.gl/*, @math.gl/*, @hubble.gl/*, styled-components,
59+
// react and react-dom from the example root to guarantee a single instance of
60+
// each package regardless of where the import originates.
7661
plugins: [
7762
{
7863
name: 'dedupe-deck-luma',
7964
setup(build) {
80-
// Re-resolve any @deck.gl/*, @luma.gl/*, @math.gl/*, @hubble.gl/*,
81-
// react-map-gl, styled-components, react, and react-dom import from the
82-
// example root so that Node's resolution always lands in this example's
83-
// own node_modules (single instance per package).
84-
// esbuild automatically skips the current plugin for the nested resolve()
85-
// call, preventing infinite recursion.
8665
build.onResolve({filter: /^(@(deck|luma|math|hubble)\.gl\/|styled-components$|react$|react-dom$)/}, async args => {
87-
// Explicit recursion guard: esbuild is supposed to skip the current plugin
88-
// for nested build.resolve() calls, but this ensures it even if it doesn't.
8966
if (args.pluginData?.deduped) return;
9067
const result = await build.resolve(args.path, {
9168
resolveDir: __dirname,

0 commit comments

Comments
 (0)