Closed xiaoiver closed 1 year ago
之前使用了 gatsby 的插件:gatsby-plugin-workerize-loader gatsby 配置:https://github.com/antvis/G/blob/next/packages/site/gatsby-config.js#L9 背后使用的其实是 Webpack 插件:https://github.com/developit/workerize-loader 完整示例:https://github.com/antvis/G/blob/next/packages/site/examples/canvas/demo/offscreen-canvas.ts
在 dumi 中如何使用 WebWorker 呢?是否也可以使用 https://github.com/developit/workerize-loader 呢?
@PeachScript 帮忙看看这个~
可以的,用 api.chainWebpack 把这个 loader 挂上去就行:https://next.d.umijs.org/config#chainwebpack
之前使用了 gatsby 的插件:gatsby-plugin-workerize-loader gatsby 配置:https://github.com/antvis/G/blob/next/packages/site/gatsby-config.js#L9 背后使用的其实是 Webpack 插件:https://github.com/developit/workerize-loader 完整示例:https://github.com/antvis/G/blob/next/packages/site/examples/canvas/demo/offscreen-canvas.ts
在 dumi 中如何使用 WebWorker 呢?是否也可以使用 https://github.com/developit/workerize-loader 呢?