Why package.json to add the exports field!!!

This issue has been tracked since 2022-04-27.

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 wrote this answer on 2022-04-27

This was done as a major release & shouldn't be an issue for upstream packages.

The parser is exported from the main export.

wangwei2018613 wrote this answer on 2022-04-27

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 wrote this answer on 2022-04-27

You can add htmlparser2 as a dependency of your project, and npm will de-duplicate the module for you.

More Details About Repo
Owner Name fb55
Repo Name htmlparser2
Full Name fb55/htmlparser2
Language TypeScript
Created Date 2011-08-27
Updated Date 2023-03-19
Star Count 3793
Watcher Count 50
Fork Count 370
Issue Count 4

YOU MAY BE INTERESTED

Issue Title Created Date Updated Date