TrySound / rollup-plugin-uglify

Rollup plugin to minify generated bundle
MIT License
260 stars 42 forks source link

Error: `numWorkers` is not a supported option #81

Open vitalets opened 4 years ago

vitalets commented 4 years ago

Full error with stack:

[!] (plugin uglify) Error: `numWorkers` is not a supported option
DefaultsError: `numWorkers` is not a supported option
    at DefaultsError.get (eval at <anonymous> (/Users/user/projects/project1/node_modules/uglify-js/tools/node.js:18:1), <anonymous>:71:23)
    at reportError (/Users/user/projects/project1/node_modules/jest-worker/build/workers/processChild.js:107:11)
    at reportClientError (/Users/user/projects/project1/node_modules/jest-worker/build/workers/processChild.js:87:10)
    at execFunction (/Users/user/projects/project1/node_modules/jest-worker/build/workers/processChild.js:157:5)
    at execHelper (/Users/user/projects/project1/node_modules/jest-worker/build/workers/processChild.js:139:5)
    at execMethod (/Users/user/projects/project1/node_modules/jest-worker/build/workers/processChild.js:143:5)
    at process.on.request (/Users/user/projects/project1/node_modules/jest-worker/build/workers/processChild.js:64:7)
    at process.emit (events.js:198:13)

Rollup config:

rollup({
  input: "main.js",
  plugins: [
    uglify({
      numWorkers: 1
    })
  ]
});

versions:

    "rollup": "^1.27.14",
    "rollup-plugin-uglify": "^6.0.4",
oMaten commented 4 years ago

Same problem occurred on my project with rollup-plugin-uglify@6.0.4

oMaten commented 4 years ago

@vitalets I found that option has been removed but the doc not updated yet, https://github.com/TrySound/rollup-plugin-uglify/issues/53#issuecomment-457669196

TrySound commented 4 years ago

It was not removed but not properly handled. Anyway, use rollup-plugin-terser. It's well maintained and support es6+ syntax. https://github.com/TrySound/rollup-plugin-terser