Skip to content

Commit

Permalink
fix: Add fix for CJS entrypoints types, similar to Langchain.JS
Browse files Browse the repository at this point in the history
  • Loading branch information
dqbd committed Mar 27, 2024
1 parent cd19ad5 commit 13c5dbb
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion js/scripts/create-entrypoints.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ const generateFiles = () => {
],
[`${key}.js`, `export * from '${compiledPath}'`],
[`${key}.d.ts`, `export * from '${compiledPath}'`],
[`${key}.d.cts`, `export * from '${compiledPath}'`],
];
}
);
Expand Down Expand Up @@ -62,7 +63,11 @@ const updateConfig = () => {
Object.fromEntries(
["index", ...Object.keys(entrypoints)].map((key) => {
let entryPoint = {
types: `./${key}.d.ts`,
types: {
import: `./${key}.d.ts`,
require: `./${key}.d.cts`,
default: `./${key}.d.ts`,
},
import: `./${key}.js`,
require: `./${key}.cjs`,
};
Expand Down

0 comments on commit 13c5dbb

Please sign in to comment.