Closed ssi02014 closed 10 months ago
Oh, nice, thanks! Just wondering for version purposes, will this break things for folks after a release?
@cure53 I don't think this changes much !
If you use import
, you'll get "./node_modules/dompurify/dist/purify.es.mjs"
, and if you use require
, you'll get "./node_modules/dompurify/dist/purify.cjs.js"
.
If the build files we provide are good, then everything should be fine.
Awesome, thank you very much :bow: :smile:
Summary
@cure53 👋 Even if you currently import DOMPurify with import, it will import files in
umd
format.We can apply
Conditional Exports
so that we get files inesm
format when importing withimport
, and files incjs
format when importing withrequire
.Reference
https://nodejs.org/api/packages.html#conditional-exports https://nodejs.org/api/packages.html#dual-commonjses-module-packages
Also, why not change it to a
.mjs
file extension to make it clear that it is anesm
format?It seems like a lot of file changes, but I reinstalled the dependencies and built, and there are differences like line breaks. 😂