diff --git a/babel.config.js b/babel.config.js index b9ca74946c..d39a695139 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 d4eaff945f..2d59eb0b48 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