babel-merge
babel-merge copied to clipboard
[Feature Request] Handle the scene that a plugin/preset with explicit name can be used multiple times.
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"]
]
}
Hi! Thank you for filing this issue. I agree this is a bug. Would you be open to creating a PR for it? :-)