When passing an Uglify option that is a regex, Uglify fails with error TypeError: regex.test is not a function as it seems rollup-plugin-uglify somehow transform regexps into strings.
It might happen when passing the option object to the jest-worker.
Here is the config to reproduce:
import { rollup } from "rollup";
import { uglify } from "rollup-plugin-uglify";
rollup({
input: "main.js",
plugins: [uglify({mangle: {properties: {regex: /^_/}}})]
});