Skip to content

Kepler.gl is a powerful open source geospatial analysis tool for large-scale data sets.

[fix] fix yarn cover regression (#2846)

Igor Dykhtaa2abbf72d2fc
diff --git a/babel.config.js b/babel.config.js
index b9ca74946..d39a69513 100644
--- a/babel.config.js
+++ b/babel.config.js
@@ -32,6 +32,8 @@ const PLUGINS = [
// We explicitly transpile this ESM library in scripts/fix-dependencies.js and consume the transpiled version here
// This may not be needed once switch to Jest is complete as it is handled by transformIgnorePatterns
'@mapbox/tiny-sdf': `${nodeModules}/@mapbox/tiny-sdf/index.cjs`,
+ // fix ERR_REQUIRE_ESM in yarn cover
+ 'maplibregl-mapbox-request-transformer': `${nodeModules}/maplibregl-mapbox-request-transformer/src/index.cjs`,
// compile from @kepler.gl src
...RESOLVE_ALIASES,
// loaders.gl cjs bundle of polyfills is not transpiled properly, use esm instead
diff --git a/scripts/fix-dependencies.sh b/scripts/fix-dependencies.sh
index d4eaff945..2d59eb0b4 100755
--- a/scripts/fix-dependencies.sh
+++ b/scripts/fix-dependencies.sh
@@ -13,3 +13,6 @@ yarn babel node_modules/@mapbox/tiny-sdf/index.js | tail -n +2 > node_modules/@m
if [[ -f "node_modules/react-virtualized/dist/es/WindowScroller/utils/onScroll.js" ]]; then
sed -i -e '/import { bpfrpt_proptype_WindowScroller } from "..\/WindowScroller.js";/d' node_modules/react-virtualized/dist/es/WindowScroller/utils/onScroll.js
fi
+
+# fix ERR_REQUIRE_ESM in yarn cover
+yarn babel node_modules/maplibregl-mapbox-request-transformer/src/index.js | tail -n +2 > node_modules/maplibregl-mapbox-request-transformer/src/index.cjs
\ No newline at end of file