如何获得正确的react-beautiful-dnd库构建?

问题描述

我为react-beautiful-dnd github项目做了一个分叉,并添加了一些功能 但是当我使用 yarn run build构建fork并在项目中使用新的dist时,会遇到编译问题

./node_modules/suivi-beautiful-dnd-with-custom-payload/dist/react-beautiful-dnd.esm.js
Module not found: Can't resolve './view/drag-drop-context/index.js' in 'C:\Users\tahas\OneDrive\Bureau\Backend\Statsh\Statsh.Frontend_POC\node_modules\suivi-beautiful-dnd-with-custom-payload\dist'

我看到我在npm中构建的版本和react-beautiful-dnd npm 提供的版本之间存在差异,但是我不知道为什么有所不同,或者我没有更改package.json文件中的构建配置?

我的npm构建的屏幕截图:

image

react-beautiful-dnd npm提供的构建的屏幕截图:

image

如何解决该问题?

解决方法

我创建了自己的样板来构建项目,并且现在可以使用! https://github.com/ProNoob702/Boilerplate-to-build-custom-react-beautiful-dnd