Why package.json to add the exports field!!!
Neper98 opened this issue · 3 comments
Neper98 commented
Why package.json to add the exports field, which makes the dependent package downloaded by my project unable to be imported correctly like 'lib/Parser'
fb55 commented
This was done as a major release & shouldn't be an issue for upstream packages.
The parser is exported from the main export.
Neper98 commented
Now i use a package which depends htmlparser2, but it write require("htmlparser2/lib/Parser")
and its package.json write "htmlparser2": ">=4.1.0"
, how can i avoid webpack running error? help!
fb55 commented
You can add htmlparser2
as a dependency of your project, and npm will de-duplicate the module for you.