fix(js-sdk): bring back cjs exports

This commit is contained in:
Andrei Bobkov 2024-09-11 17:53:17 +03:00
parent fe8f9d4b2f
commit f6fc71b46a
No known key found for this signature in database
GPG Key ID: C6A81E5087221625
4 changed files with 1560 additions and 20 deletions

File diff suppressed because it is too large Load Diff

View File

@ -4,9 +4,16 @@
"description": "JavaScript SDK for Firecrawl API",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"exports": {
"./package.json": "./package.json",
".": {
"import": "./dist/index.js",
"default": "./dist/index.cjs"
}
},
"type": "module",
"scripts": {
"build": "tsc",
"build": "tsup",
"build-and-publish": "npm run build && npm publish --access public",
"publish-beta": "npm run build && npm publish --access public --tag beta",
"test": "NODE_OPTIONS=--experimental-vm-modules jest --verbose src/__tests__/v1/**/*.test.ts"
@ -40,6 +47,7 @@
"@types/uuid": "^9.0.8",
"jest": "^29.7.0",
"ts-jest": "^29.2.2",
"tsup": "^8.2.4",
"typescript": "^5.4.5"
},
"keywords": [

View File

@ -16,17 +16,9 @@
"noUncheckedIndexedAccess": true,
"noImplicitOverride": true,
/* If transpiling with TypeScript: */
/* If NOT transpiling with TypeScript: */
"module": "NodeNext",
"outDir": "dist",
"rootDir": "src",
"sourceMap": true,
/* AND if you're building for a library: */
"declaration": true,
/* AND if you're building for a library in a monorepo: */
"declarationMap": true /* Skip type checking all .d.ts files. */
"noEmit": true,
},
"include": ["src/**/*"],
"exclude": ["node_modules", "dist", "**/__tests__/*"]

View File

@ -0,0 +1,9 @@
import { defineConfig } from "tsup";
export default defineConfig({
entryPoints: ["src/index.ts"],
format: ["cjs", "esm"],
dts: true,
outDir: "dist",
clean: true,
});