Webpack packaging multithreaded files

how to package a multithreaded file in webpack. Because the amount of data is too large, you want to use multithreading to process the data.
`
main.js

import css from".. / src/app.css"
import cationData from". / worker.js"

/ / data classification
function classificationData (data) {

//
let worker = new Worker(cationData)

//
worker.addEventListener("message", function(e){
    console.log(e.data)
})

// 
worke.postMessage(data)

} `

worker.js

onmessage = function(e){

    console.log(e.data)


    postMessage("aa")
}
Mar.15,2021
Menu