【发布时间】:2019-02-07 13:36:14
【问题描述】:
我不断收到错误:
Module build failed (from ./node_modules/babel-loader/lib/index.js):
Error: Duplicate plugin/preset detected.
If you'd like to use two separate instances of a plugin,
they need separate names, e.g.
plugins: [
['some-plugin', {}],
['some-plugin', {}, 'some unique name'],
]
这是我的 babelrc 及其要求的更改:
{
"presets": [
["@babel/env"],
["@babel/preset-react"]
],
"plugins": [
["@babel/plugin-syntax-jsx"],
["@babel/plugin-transform-react-jsx"],
["@babel/plugin-transform-react-display-name"],
["@babel/plugin-transform-react-jsx-self"],
["@babel/plugin-transform-react-display-name"]
]
}
不确定我在哪里有错误的文件语法。这也是我第一次使用 babel 为 react 应用程序配置 webpack4。请让我知道如果一切看起来都很好,可以与 react 一起使用。
【问题讨论】:
-
我在您的列表中看到了两次“plugin-transform-react-display-name”。