Skip to content
This repository has been archived by the owner on Nov 30, 2023. It is now read-only.

Error when using mangle.properties.regex option #3

Closed
maxmilton opened this issue Aug 31, 2018 · 1 comment
Closed

Error when using mangle.properties.regex option #3

maxmilton opened this issue Aug 31, 2018 · 1 comment

Comments

@maxmilton
Copy link

When passing the mangle.properties.regex option the following error is thrown:

> Building...
    regex.test is not a function

> regex.test is not a function
error Command failed with exit code 1.

Example options:

...
terser({
  mangle: {
    properties: {
      regex: /^_.+$/,
    },
  },
});
...

Since a regex literal is being used I assume there's a problem serialising it's when it's being passed into the worker (new v2.0.0 feature). I haven't used the jest-worker package before so I'm not sure how it passes data exactly. I could imagine a way around this is to convert the regex into a string, send it, and then back into a regex in the worker but I'm not sure that's viable with jest-worker.

@TrySound
Copy link
Owner

Fixed in Fixed in https://github.com/TrySound/rollup-plugin-terser/releases/tag/v3.0.0

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants