Skip to content

Optimize Plugin API to Avoid Passing Full docx Module #1

@mayank1513

Description

@mayank1513

Currently, when using plugins in mdast2docx, we must pass the entire docx module (import * as docx from "docx") to plugin functions.

🔗 Related Discussion: [#6](md2docx/mdast2docx#6)
🔗 Blocking Issue in docx Library: [dolanmiu/docx#2988](dolanmiu/docx#2988)

Problem:

  • This approach increases bundle size unnecessarily.
  • Ideally, each plugin should import only the docx components it needs.
  • However, due to how docx handles exports, this is not currently possible.

Proposed Solution (Dependent on docx Fix):

📌 Next Steps:

  • Monitor the upstream issue in docx.
  • If a workaround is available, implement it before the official fix.
  • Refactor mdast2docx plugins accordingly once the issue is resolved.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions