如何告诉Webpack仅/始终使用包json中显示的版本?

问题描述 投票:0回答:0

我正在尝试为npm软件包(react-draft-wysiwyg)做出贡献,但不断出现(我认为是)Webpack错误。

首先,我尝试单击草稿js的嵌入按钮,并且错误提示“阻止不是BlockNode”-然后我关注这样的博客/帖子https://github.com/facebook/draft-js/issues/1763我将对等项依赖项和主项目pkg json依赖项与draft-js v0.10.4匹配,重新学习并说

Element ref was specified as a string (editorContainer) but no owner was set. This could happen for one of the following reasons:

1. You may be adding a ref to a function component
2. You may be adding a ref to a component that was not created inside a component's render method
3. You have multiple copies of React loaded

所以在我的项目的webpack.config.js中,我有:

alias: {
        react: path.resolve('node_modules/react'),
        modules: [path.resolve(__dirname, "app"), "node_modules"],
      },

我真的认为这些问题是由于webapp试图从本地yarn link's中获取不同版本的反应而引起的。

我如何告诉Webpack仅在其他所有内容上使用顶级功能?

救命?

javascript webpack webpack-dev-server draftjs
© www.soinside.com 2019 - 2024. All rights reserved.