Skip to content
This repository was archived by the owner on Jan 18, 2024. It is now read-only.
This repository was archived by the owner on Jan 18, 2024. It is now read-only.

[Feature Request] Handle the scene that a plugin/preset with explicit name can be used multiple times. #35

@ulivz

Description

@ulivz

Feature Request

A plugin / preset can be applied multiple times when the 3rd parameter(i.e. "name", refs.) of a config item is given.

Repro Example

const merge = require('babel-merge');

const together = merge(
  {
    plugins: [
      ["import", { "libraryName": "antd", "libraryDirectory": "lib" }, "ant" /* name */],
    ]
  },
  {
    plugins: [
      ["import", { "libraryName": "antd-mobile", "libraryDirectory": "lib" }, "antd-mobile" /* name */]
    ]
  }
)

console.log(together)

Expected behaviors

{
    plugins: [
      ["/path/to/babel-plugin-import", { "libraryName": "antd", "libraryDirectory": "lib" }, "ant"],
      ["/path/to/babel-plugin-import", { "libraryName": "antd-mobile", "libraryDirectory": "lib" }, "antd-mobile"]
    ]
}

Actual behaviors

{
    plugins: [
        ["/path/to/babel-plugin-import", { "libraryName": "antd-mobile", "libraryDirectory": "lib" }, "antd-mobile"]
    ]
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions