Skip to content

plugin 类型统一 #104

Open
Open
@ClarkXia

Description

@ClarkXia

在 build-scripts 2.0 设计中支持的 plugin 设置包括以下两种:

  • PluginOption { name, plugin, runtime}
  • Plugin

PluginOption 的类型名称定位上不够清晰,跟其内部的 plugin 关系有重叠

备选方案:

统一导出 plugins 配置类型: type Plugin = PluginOption | PluginLegacy | [string, object]
PluginOption 包含 { name, setup, runtime } / { name, config, runtime }

Activity

wssgcg1213

wssgcg1213 commented on Jun 15, 2022

@wssgcg1213
type Plugin = _Plugin | PluginLegacy;

interface _Plugin {
  name: string;
  setup?: Setup;
  runtime?: string;
}

PluginLegacy 就是兼容之前各种类型, 但是不推荐的
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

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      plugin 类型统一 · Issue #104 · ice-lab/build-scripts