Skip to content

Parser from markdown-exit/core still bundles the renderer and presets #42

Closed

Description

@onmax

Summary

A markdown-exit/parser entry that exports Parser without the renderer and presets.

Motivation

import { Parser } from 'markdown-exit/core' also bundles the renderer and presets, because tsdown emits core as one chunk. Comark only calls md.parse(), so it ships code it never runs.

Before is import { Parser } from 'markdown-exit/core', after is the same import from markdown-exit/parser.

before after change
minified 98.2 KiB 89.9 KiB -8.3 KiB
gzip 33.91 KiB 31.25 KiB -2.66 KiB

Proposed Solution

Add src/index.parser.ts, which re-exports ./parser and ./token, as a tsdown entry and a ./parser export. Its tokens match MarkdownExit().parse() on all 2,597 fixture blocks. Setting "sideEffects": ["./dist/index.js"] would shrink the core import to 31.3 KiB as well, but I haven't checked every module for side effects.

Would you take a PR? Related: markdown-it/markdown-it#924.

Would you like to work on this new feature?

  • I'm interested in working on this new feature

Activity

  1. serkodev commented on Nov 16, 2026

    @serkodev
    Owner

    Do you think #49 can solve this problem?

  2. onmax commented on Nov 16, 2026

    @onmax
    ContributorAuthor

    Yes, I think #49 solves it. I closed #46, and I don't think this issue needs to stay open because with #49 importing only Parser from markdown-exit/core already drops the renderer and presets, so a separate entry is not needed anymore

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions