javascript - 我如何告诉 Webpack 只/总是使用包 json 中显示的版本?
问题描述
我正在尝试为 npm 包(react-draft-wysiwyg)做出贡献,但不断收到(我认为是)Webpack 错误。
首先,我尝试单击 Draft-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"],
},
我真的认为这些问题源于网络应用程序试图从本地纱线链接中提取不同版本的反应。
我如何告诉 Webpack 只使用顶层,而不是其他所有东西?
帮助?
解决方案
推荐阅读
- ruby-on-rails - Rails:渲染由回形针上传的视频
- reactjs - 在新的反应项目中运行 npm start 命令时出现控制台错误
- node.js - 在所有其他脚本之前运行 NPM 脚本
- javascript - 如何从 JS 中的实例化中获取类?
- build - ./toolchain.py:找不到命令(kivy)
- c# - 使用 WPF .Net.Core 从 windows 环境为 mac os 制作多平台应用程序
- javascript - 如何从输入字段编辑表数据的值
- php - 为什么这个 PHP 递归函数不起作用
- python - 在 Pandas 数据框中对行进行分组,应用自定义函数并将结果作为行存储在新数据框中
- python-3.x - 气流 - 在初始化期间修补函数