kopia lustrzana https://github.com/transitive-bullshit/chatgpt-api
feat: re-add cjs support, fixed "Error [ERR_REQUIRE_ESM]: require() of ES Module not supported."
rodzic
de113365c7
commit
72aec6bae1
14
package.json
14
package.json
|
@ -5,13 +5,13 @@
|
|||
"author": "Travis Fischer <travis@transitivebullsh.it>",
|
||||
"repository": "transitive-bullshit/chatgpt-api",
|
||||
"license": "MIT",
|
||||
"type": "module",
|
||||
"source": "./src/index.ts",
|
||||
"types": "./build/index.d.ts",
|
||||
"main": "./build/index.js",
|
||||
"exports": {
|
||||
".": {
|
||||
"import": "./build/index.js",
|
||||
"default": "./build/index.js",
|
||||
"import": "./build/index.mjs",
|
||||
"require": "./build/index.js",
|
||||
"types": "./build/index.d.ts"
|
||||
}
|
||||
},
|
||||
|
@ -37,15 +37,15 @@
|
|||
"dependencies": {
|
||||
"eventsource-parser": "^0.0.5",
|
||||
"expiry-map": "^2.0.0",
|
||||
"node-fetch": "2",
|
||||
"remark": "^14.0.2",
|
||||
"strip-markdown": "^5.0.0",
|
||||
"node-fetch": "^2.6.7",
|
||||
"remark": "^13.0.0",
|
||||
"strip-markdown": "^4.2.0",
|
||||
"uuid": "^9.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@trivago/prettier-plugin-sort-imports": "^4.0.0",
|
||||
"@types/node": "^18.11.9",
|
||||
"@types/node-fetch": "2",
|
||||
"@types/node-fetch": "^2.6.2",
|
||||
"@types/uuid": "^9.0.0",
|
||||
"del-cli": "^5.0.0",
|
||||
"dotenv-safe": "^8.2.0",
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { remark } from 'remark'
|
||||
import remark from 'remark'
|
||||
import stripMarkdown from 'strip-markdown'
|
||||
|
||||
export function markdownToText(markdown?: string): string {
|
||||
|
|
|
@ -5,7 +5,7 @@ export default defineConfig({
|
|||
outDir: 'build',
|
||||
target: 'node14',
|
||||
platform: 'node',
|
||||
format: ['esm'],
|
||||
format: ['esm', 'cjs'],
|
||||
splitting: false,
|
||||
sourcemap: true,
|
||||
minify: true,
|
||||
|
|
Ładowanie…
Reference in New Issue