Bower issues : DOMPurify is not defined
Background & Context
Hi, sorry in advance for my broken english. We had a legacy project based on bower dependencies management. Thanks, this project is available in this.
Bug
When the project started, i have this :
Uncaught ReferenceError: DOMPurify is not defined
On check in bower file bower.json and .bower.json, the main file declared is :
"main": "src/purify.js",
I think the right file to use must be : /dist/purify.min.js
After some tests with this dist file, it work like a charm
Input
<html>
<head>
<script type="text/javascript" src="./bower_components/dompurify/dist/purify.min.js"></script>
<script>
var clean = DOMPurify.sanitize("<p>dirty</p>", { ALLOWED_TAGS: [] });
console.log(clean)
</script>
</head>
</html>
Here a mini use case : bower_and_dompurify.zip
Given output
Output with actual bower files :
Uncaught ReferenceError: DOMPurify is not defined
Expected output
No error
Regards
Heya, oha, thanks for noticing, does the commit linked above fix the issue for you?
Hello, thanks for the reply 👍🏽
I reproduce this modification, and it works very well
thanks again 🙂
Cool, we say thanks!
Hi,
Thanks for the new release.
Can you make the same fix on 2.X branch or do you prefer i create a new issue for this?
Aye, sorry - this is now fixed :smile: