Skip to content

Supercharge your AI agents with data from the web and beyond. Building the library for superintelligence. 🔥

Merge pull request #432 from mendableai/mog/js-sdk-cjs

Nicolasbb90e03dea5d
diff --cc apps/js-sdk/firecrawl/package.json
index 71d2362ed,178e5c662..5a6d6bfb4
--- a/apps/js-sdk/firecrawl/package.json
+++ b/apps/js-sdk/firecrawl/package.json
@@@ -2,14 -2,18 +2,18 @@@
"name": "@mendable/firecrawl-js",
"version": "0.0.29",
"description": "JavaScript SDK for Firecrawl API",
- "main": "build/index.js",
+ "main": "build/cjs/index.js",
"types": "types/index.d.ts",
"type": "module",
+ "exports": {
+ "require": "./build/cjs/index.js",
+ "import": "./build/esm/index.js"
+ },
"scripts": {
- "build": "tsc",
+ "build": "tsc --module commonjs --moduleResolution node10 --outDir build/cjs/ && echo '{\"type\": \"commonjs\"}' > build/cjs/package.json && npx tsc --module NodeNext --moduleResolution NodeNext --outDir build/esm/ && echo '{\"type\": \"module\"}' > build/esm/package.json",
"build-and-publish": "npm run build && npm publish --access public",
"publish-beta": "npm run build && npm publish --access public --tag beta",
- "test": "jest src/__tests__/**/*.test.ts"
+ "test": "NODE_OPTIONS=--experimental-vm-modules jest --verbose src/__tests__/**/*.test.ts"
},
"repository": {
"type": "git",