Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(package.json): add dist/purify.js and dist/purify.min.js to exports as targetable modules #1065

Merged
merged 1 commit into from
Feb 22, 2025

Conversation

reey
Copy link
Contributor

@reey reey commented Feb 19, 2025

Summary

This pull request tries to solve a similar issue as described in: #1050 and fixed in #1053

In our case we are importing this lib via dompurify/dist/purify.js. Which fails with the recent versions of this lib since the exports field was introduced with this error message:

Error: Module not found: Error: Package path ./dist/purify.js is not exported from package node_modules/dompurify (see exports field in node_modules/dompurify/package.json)

Background & Context

I won't go to much into details here as it is basically the same story as in #1053.
This could probably also be solved by anyone using this lib by adapting the import of this lib from dompurify/dist/purify.js to dompurify/purify.js, but this way it would not require a change for anyone still using dompurify/dist/purify.js.

Tasks

  • Install PR
  • Import DOMPurify
  • Using any of the existing methods should continue to work (ie: DOMPurify.sanitize)

Dependencies

  • Resolved dependency
  • Open dependency

@cure53
Copy link
Owner

cure53 commented Feb 22, 2025

Hey there, thanks a lot, this looks great 🙂

@cure53 cure53 merged commit 6769460 into cure53:main Feb 22, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants