In my package.json, under dependencies, I added a new one:
And then in my site’s code I use this new package:
import purify from "DOMPurify"; purify.sanitize(html);
Locally, everything works great. No errors while in dev mode, no errors when I create a production build either. But when I deploy my site to Netlify and it creates a build, I get an error saying
ReferenceError: Can't find variable: purify when I open the site.
I tried to rebuild without cache, but that didn’t help. What else could it be?