这个错误通常是由于项目中使用的ESLint版本与其他依赖不兼容导致的。 这个错误信息 syntax error: thread loader (worker 0) eslint.cliengine is not a constructor 表明在构建过程中,thread-loader 在处理文件时遇到了问题,具体是因为 eslint.CLIEngine 不是一个构造函数。这个问题通常与ESLint的版本升级有关。 解...
declare module "worker-loader!*" { // You need to change `Worker`, if you specified a different value for the `workerType` option class WebpackWorker extends Worker { constructor(); } // Uncomment this if you set the `esModule` option to `false` // export = WebpackWorker; export ...
Documentation does not suggest any solution for this. What is the expected behavior? Two options: Provide a good example how to make it work using modern approach or Un-deprecate worker-loader and provide documentation when to use it, and hopefully fix the additional issue Additional issue If ...
If it's any help, this is what I've been doing. // src/MyWorker/worker.tsconstctx:Worker=selfasany;ctx.onmessage=event=>{// ...ctx.postMessage(/* response */);}; // src/MyWorker/custom.d.tsdeclaremodule'worker-loader!*'{classWebpackWorkerextendsWorker{constructor();}export=Webpa...