Conversation
|
Blocked by move to node24 (LTS) from node18 #1072 |
| "*": [ | ||
| "./dist/esm/*" | ||
| ] | ||
| "./*.js": { |
There was a problem hiding this comment.
I really hate this. But it is required to do this and not break existing code.
import { McpServer } from "@modelcontextprotocol/sdk/server.js";
package.json
Outdated
| "require": "./dist/cjs/validation/index.js" | ||
| "import": "./dist/validation/index.js", | ||
| "require": "./dist/validation/index.cjs", | ||
| "types": "./dist/validation/index.d.ts" |
There was a problem hiding this comment.
I think "types" has to be the first field here (and everywhere else)
|
Hey @mattzcarey thanks for this! @pcarleton and I discussed and we're not sure introducing this relatively new dependency over Couldn't we address these issues here without needing to introduce
|
|
Hey @felixweinberger. Agreed The main reason to switch to In general it has these advantages:
If you dont change to |
|
@mattzcarey tsdown uses rolldown, not esbuild Also the |
|
Done in |
tsdown is a popular build tool for typescript. It can natively bundle
cjsandesmhandling alot of the best practise, reducing the burden on this libMotivation and Context
cjsandesm.How Has This Been Tested?
Tested in an external repo. there are no obvious changes.
Breaking Changes
No
I havent changed anything about modules are imported. Although the way they are imported using this lib is not standard. In bundled libraries you tend not to need to import from *.js, and it is best practise to explicitly decide what is exported from each module with an index.ts/js file.
MCP SDK exports every file and relies on
exportkeywords in the files themselves, whilst using some named exports for modules. I'd like to think more about this and clean it up before the next major release.Types of changes
Checklist
Additional context
main - (tsc):
Build time: 4.81s
Dist size: 8.67 MB
File count: 458
tsdown:
Build time: 3.78s
Dist size: 7.67 MB
File count: 358
Improvements:
Build time: +21.3% (+1.02s)
Dist size: +11.6% (+1.01 MB)
File count: -100