Skip to content

Fails with (uglify plugin) TypeError: regex.test is not a function #51

@pvdlg

Description

@pvdlg

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: /^_/}}})]
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions