承接 drupal/mjml_render_bin 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

drupal/mjml_render_bin

最新稳定版本:1.0.0

Composer 安装命令:

composer require drupal/mjml_render_bin

包简介

Standalone MJML to HTML renderer with pre-built binaries. No Node.js required at runtime.

README 文档

README

Standalone MJML to HTML renderer with pre-built binaries. No Node.js required at runtime.

Installation

composer require drupal/mjml_render_bin

The Composer plugin automatically detects your platform and downloads the correct MJML binary during installation.

Supported Platforms

PlatformArchitecture
Linuxx64
LinuxARM64 (Not yet supported by CI)
macOS (Darwin)x64
macOS (Darwin)ARM64 (Not yet supported by CI)

Usage

use Drupal\mjml_render_bin\MjmlBinaryRenderer;

$renderer = new MjmlBinaryRenderer();

$html = $renderer->render('
<mjml>
  <mj-body>
    <mj-section>
      <mj-column>
        <mj-text>Hello World</mj-text>
      </mj-column>
    </mj-section>
  </mj-body>
</mjml>
');

Custom Binary Path

Pass a custom binary path to the constructor:

$renderer = new MjmlBinaryRenderer('/path/to/custom/mjml');

When used with the drupal/mjml_render_engine module, configure the path in settings.php or settings.local.php:

$settings['mjml_render_bin.path'] = '/path/to/custom/mjml';

Building a Custom Binary

Use Docker to build an MJML binary without installing Node.js locally:

# Build the latest MJML binary for Linux x64
docker run --rm -v $(pwd)/custom-bin:/output node:22-alpine sh -c \
  "npm install -g mjml @yao-pkg/pkg && \
   pkg \$(which mjml) -t node22-linuxstatic-x64 -o /output/mjml"

# Build a specific MJML version (e.g., 4.15.3)
docker run --rm -v $(pwd)/custom-bin:/output node:22-alpine sh -c \
  "npm install -g mjml@4.15.3 @yao-pkg/pkg && \
   pkg \$(which mjml) -t node22-linuxstatic-x64 -o /output/mjml"

# Build for macOS ARM64 (Apple Silicon)
docker run --rm -v $(pwd)/custom-bin:/output node:22-alpine sh -c \
  "npm install -g mjml @yao-pkg/pkg && \
   pkg \$(which mjml) -t node22-macos-arm64 -o /output/mjml"

Then configure the path as described above.

How It Works

This package uses a branching strategy to deliver platform-specific binaries without bloating the main package:

  • The main branch contains only PHP code (~50KB)
  • Stable tags (e.g., 1.0.0) are created on the main branch
  • Platform branches (e.g., 1.0.0-linux-x64) contain the compiled binary
  • When you composer require drupal/mjml_render_bin:^1.0, Composer installs the lightweight 1.0.0 tag from main
  • The Composer plugin detects your platform and downloads the binary from the matching platform-suffixed branch (e.g., 1.0.0-linux-x64)

Assisted By

Initial release made possible with the assistance of Claude Opus 4.6 and Gemini 3.1 Pro.

License

GPL-2.0-or-later

统计信息

  • 总下载量: 28
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-2.0-or-later
  • 更新时间: 2026-04-27

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固