cure53 / DOMPurify

DOMPurify - a DOM-only, super-fast, uber-tolerant XSS sanitizer for HTML, MathML and SVG. DOMPurify works with a secure default, but offers a lot of configurability and hooks. Demo:
https://cure53.de/purify
Other
13.67k stars 698 forks source link

Trying to use in Angular 16, getting "CommonJS or AMD dependencies can cause optimization bailouts." #869

Closed motohead400 closed 10 months ago

motohead400 commented 10 months ago

Is it possible to have an ES6 module export version of this?

cure53 commented 10 months ago

We're open to a PR for this if you set one up :)

jeroen1602 commented 1 week ago

I found that manually adding "es2020": "./dist/purify.es.mjs", gets rid of the warning.

But I'm not sure if this is the correct method, I'm not very familiar with creating js libraries.

I also found what I believe is the order that the Angular compiler uses to find the entry point for future reference

https://github.com/angular/angular-cli/blob/d6a34034d7489c09753090642ade4c606cd98ece/packages/angular/build/src/tools/esbuild/application-code-bundle.ts#L50

cure53 commented 1 week ago

Oha, would that be worth a PR? :smile:

jeroen1602 commented 1 week ago

I'll make one.

PR has been created #990