Closed shaggyfrog closed 3 years ago
Definitely it was a mistake. Thanks for pointing out!
@shaggyfrog I just released a new version here: https://github.com/Yoctol/react-d3-cloud/releases/tag/v1.0.4 See if it works in your case.
@chentsulin It works, thanks!
I am working on a project using an older version of react-d3-cloud, 0.11.0, before it was converted to Typescript.
When I update the dependency to 1.0.3, webpack fails to build.
The library is imported in a normal way:
import WordCloud from 'react-d3-cloud';
However, webpack is unable to resolve the reference.Looking at package.json, I believe the
main
field is defined correctly:https://github.com/Yoctol/react-d3-cloud/blob/02cd7f477d3aae8292e4d86e58b8888135ab1394/package.json#L12
The
exports
field was added in 1.0.1, and it is defined as:https://github.com/Yoctol/react-d3-cloud/blob/02cd7f477d3aae8292e4d86e58b8888135ab1394/package.json#L93-L94
The webpack documentation says that the
exports
field overrides the value ofmain
.I believe the paths in the values for these two fields is incorrect. Looking at the actual package inside
node_modules
after installing, I believe these field values should beIf I use 1.0.0 (the first version with Typescript), webpack builds correctly. If I use 1.0.1, when the
exports
field was added, webpack fails.Is this correct, or am I installing/using react-d3-cloud incorrectly?