Skip to content

[editor v2][P6] 构建发布(插件 runtime 端打入 + npm files 修复) #277

Description

@wardenfeng

已决策:插件 runtime 端装载走 A(构建时打入)。

任务

  • build / publish:按项目启用状态把插件 runtime 端产物合并进游戏 bundle(未启用的不参与)——src/plugins/state.ts 的开关必须参与构建流程
  • tree-shake 校验:未启用插件的 runtime 端不被打进产物(可复用 scripts/check-tree-shaking.mjs 的产物断言思路);runtime 端不得有模块级副作用(与 R2 同向)
  • 修 packages/editor/package.json 的 files 白名单:现状(:35-44)不含 libs/ 与 packages/,而源码仍会 window.open('packages/codeeditor/codeeditor.html')(ScriptCompiler.ts:43)→ 发布版必然 404
  • 游戏项目服务端支持(需求方提到"不排除还会有游戏服务端的开发"):项目可含 server/(Node),发布时与 Web 端一起产物化
  • 记录已知取舍:运行时装插件不改变游戏端行为,游戏端要重新构建才生效

验收

  • 发布产物在无编辑器环境运行通过
  • 未启用插件的 runtime 端不被打进产物(tree-shake 断言)
  • npm run release:dry-run -- --force 通过(根 AGENTS.md §16)

依据:ARCHITECTURE.md §6.5 / D4 / D12

Activity

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

    优先级-中重要但可在地基之后进行新功能New feature or request

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions