diff --git a/.changeset/bundle-yaml-esm.md b/.changeset/bundle-yaml-esm.md new file mode 100644 index 0000000..bdad0e8 --- /dev/null +++ b/.changeset/bundle-yaml-esm.md @@ -0,0 +1,5 @@ +--- +'@tanstack/intent': patch +--- + +Make the installed package 28 kB smaller by bundling `yaml` from its ES module build instead of its CommonJS build. A YAML warning, such as an unresolved tag in skill frontmatter, is now written to stderr by `console.warn`, with a stack trace; before, it went through `process.emitWarning`, and `intent list` and `intent stale` exited before Node printed it. The `LOG_STREAM` and `LOG_TOKENS` environment variables no longer make the YAML parser print its tokens to stdout. diff --git a/packages/intent/tsdown.config.ts b/packages/intent/tsdown.config.ts index dca2b22..6879fe5 100644 --- a/packages/intent/tsdown.config.ts +++ b/packages/intent/tsdown.config.ts @@ -61,5 +61,10 @@ export default defineConfig({ 'jsonc-parser': fileURLToPath( new URL('./node_modules/jsonc-parser/lib/esm/main.js', import.meta.url), ), + // yaml's `node` export condition is a CommonJS build that rolldown cannot + // tree-shake; point at the ES module build its `default` condition serves. + yaml: fileURLToPath( + new URL('./node_modules/yaml/browser/index.js', import.meta.url), + ), }, })