Skip to content
This repository has been 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

Open
ulivz opened this issue Dec 23, 2019 · 1 comment
Labels

Comments

@ulivz
Copy link

ulivz commented Dec 23, 2019

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"]
    ]
}
@ulivz ulivz changed the title Handle the scene that a plugin/preset with explicit name can be used multiple times. [Feature Request] Handle the scene that a plugin/preset with explicit name can be used multiple times. Dec 23, 2019
@edmorley edmorley added the bug label Dec 29, 2019
@edmorley
Copy link
Member

Hi! Thank you for filing this issue. I agree this is a bug. Would you be open to creating a PR for it? :-)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Development

No branches or pull requests

2 participants