Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/easy-masks-post.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@langchain/core": patch
---

add root export to satisfy bundler requirements
4 changes: 4 additions & 0 deletions langchain-core/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
index.cjs
index.js
index.d.ts
index.d.cts
agents.cjs
agents.js
agents.d.ts
Expand Down
1 change: 1 addition & 0 deletions langchain-core/langchain.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ function abs(relativePath) {
export const config = {
internals: [/node\:/, /js-tiktoken/, /langsmith/, /zod\/v[34]/],
entrypoints: {
index: "index",
agents: "agents",
caches: "caches/base",
"callbacks/base": "callbacks/base",
Expand Down
13 changes: 13 additions & 0 deletions langchain-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,15 @@
"vectorstores"
],
"exports": {
".": {
"types": {
"import": "./index.d.ts",
"require": "./index.d.cts",
"default": "./index.d.ts"
},
"import": "./index.js",
"require": "./index.cjs"
},
"./agents": {
"types": {
"import": "./agents.d.ts",
Expand Down Expand Up @@ -651,6 +660,10 @@
},
"files": [
"dist/",
"index.cjs",
"index.js",
"index.d.ts",
"index.d.cts",
"agents.cjs",
"agents.js",
"agents.d.ts",
Expand Down
22 changes: 22 additions & 0 deletions langchain-core/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/**
* @langchain/core root entry point
*
* This file exists solely to satisfy bundler requirements for packages that use
* static manual chunks (e.g., Vite's manualChunks, Webpack's splitChunks).
*
* IMPORTANT: Do not import from this root entry point in your code.
* Instead, use specific subpath imports for better tree-shaking and performance:
*
* ❌ Don't do this:
* import { BaseMessage } from "@langchain/core";
*
* ✅ Do this instead:
* import { BaseMessage } from "@langchain/core/messages";
* import { BaseChatModel } from "@langchain/core/language_models/chat_models";
*
* This approach ensures optimal bundle size and follows the intended usage pattern
* of this package.
*/

// Empty export to make this a valid ES module
export {};
Loading