terser icon indicating copy to clipboard operation
terser copied to clipboard

How to use with web worker url?

Open cuixiping opened this issue 3 years ago • 0 comments

Usage question

I have two js files: main.js and worker.js.

// main.js
let worker = new Worker('./worker.js')
// worker.js
onmessage = e => { };

After mangle, I have two files: main.min.js and worker.min.js. But the worker url in main.min.js is still ./worker.js, not ./worker.min.js as expected.

How can I make terser modify the worker url from ./worker.js to ./worker.min.js?

Expected result

// main.min.js
let s=new Worker('./worker.min.js')

cuixiping avatar Aug 19 '22 09:08 cuixiping