From c95b6b44b02b356ae1ede841a377d355b201210c Mon Sep 17 00:00:00 2001 From: Alexander Farber Date: Sun, 1 Feb 2026 20:46:28 +0100 Subject: [PATCH] Fix documentation build ESM/CommonJS conflict --- CHANGELOG.md | 1 + package-lock.json | 6 +++--- scripts/build_api_docs.sh | 5 +++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 36c391c486..554f1caa17 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ - ADDED: Add exception for audible fences (`barrier=fence` with `sensory=audible` or `sensory=audio`) that deter livestock but do not block vehicles [#6964](https://github.com/Project-OSRM/osrm-backend/issues/6964) - ADDED: Use `is_sidepath:of:name` and `street:name` as fallback names for unnamed sidewalks and sidepaths in foot and bicycle profiles [#7259](https://github.com/Project-OSRM/osrm-backend/issues/7259) - Build: + - FIXED: Documentation build fails with ESM/CommonJS conflict after adding "type": "module" [#7347](https://github.com/Project-OSRM/osrm-backend/issues/7347) - FIXED: Set `hwloc:shared=True` in Conan config as required by onetbb [#7342](https://github.com/Project-OSRM/osrm-backend/issues/7342) - CHANGED: Cucumber tests now can run in parallel and other improvements [#7309](https://github.com/Project-OSRM/osrm-backend/issues/7309) - FIXED: Update Node.js binding path from `lib/binding` to `lib/binding_napi_v8` to match node-pre-gyp versioning conventions [#7272](https://github.com/Project-OSRM/osrm-backend/pull/7272) diff --git a/package-lock.json b/package-lock.json index b26d21a933..94da603086 100644 --- a/package-lock.json +++ b/package-lock.json @@ -21825,9 +21825,9 @@ } }, "node_modules/tar": { - "version": "7.5.6", - "resolved": "https://registry.npmjs.org/tar/-/tar-7.5.6.tgz", - "integrity": "sha512-xqUeu2JAIJpXyvskvU3uvQW8PAmHrtXp2KDuMJwQqW8Sqq0CaZBAQ+dKS3RBXVhU4wC5NjAdKrmh84241gO9cA==", + "version": "7.5.7", + "resolved": "https://registry.npmjs.org/tar/-/tar-7.5.7.tgz", + "integrity": "sha512-fov56fJiRuThVFXD6o6/Q354S7pnWMJIVlDBYijsTNx6jKSE4pvrDTs6lUnmGvNyfJwFQQwWy3owKz1ucIhveQ==", "license": "BlueOak-1.0.0", "dependencies": { "@isaacs/fs-minipass": "^4.0.0", diff --git a/scripts/build_api_docs.sh b/scripts/build_api_docs.sh index 5d0c03f889..73eca1531e 100755 --- a/scripts/build_api_docs.sh +++ b/scripts/build_api_docs.sh @@ -40,8 +40,9 @@ cp docs/*.md build/docs/tmp/content # Now, run the scripts to generate the actual final product pushd build/docs/tmp NODE_ENV=production browserify src/index.js | uglifyjs -c -m > ../bundle.js -babel src --out-dir lib -node lib/render.js ../index.html +# Output as .cjs since package.json has "type": "module" +babel src --out-dir lib --out-file-extension .cjs +node lib/render.cjs ../index.html popd # Cleanup