For AI agents: the complete documentation index is available at /next/zh/llms.txt, the full documentation bundle is available at /next/zh/llms-full.txt, and this page is available as Markdown at /next/zh/lynxtron/api/@lynx-js/lynxtron-rebuild/index.md.
  • 简体中文
  • @lynx-js/lynxtron-rebuild

    @lynx-js/lynxtron-rebuild 用于将 npm Node.js 原生模块重新编译到 Lynxtron runtime ABI。它对应 Electron 生态中的 @electron/rebuild,但目标 runtime 是 Lynxtron。

    安装

    npm install -D @lynx-js/lynxtron-rebuild

    用法

    npx @lynx-js/lynxtron-rebuild

    通常在安装或更新原生模块后执行,并在打包前确认重建产物可被 Lynxtron runtime 加载。

    适用场景

    场景是否需要
    纯 JavaScript npm 包不需要 rebuild
    包含 .node 二进制的 npm 原生模块需要使用 @lynx-js/lynxtron-rebuild
    从 Electron 项目迁移过来的原生模块需要从 Electron ABI 重建到 Lynxtron runtime ABI
    Lynx 原生能力库通常通过 npm run build:shared 构建,不依赖 lynxtron-rebuild

    更多说明见 Node.js 原生模块

    除非另有说明,本项目采用知识共享署名 4.0 国际许可协议进行许可,代码示例采用 Apache License 2.0 许可协议进行许可。