[英]how to config create react app with worker-loader
I need to create an CRA(create-react-app) app with multiple workers. 我需要使用多个工作人员创建一个CRA(create-react-app)应用程序。 As an example (my workers include import modules): 例如(我的工人包括导入模块):
// worker.js
import x from 'file-xxx.js'
addEventListener('message', e => {
// ...
})
// App.jsx
App(){
const mWorker = new Worker('./worker')
mWorker.postMessage('data...')
// ...
}
I would like if one help me to construct a simple create react app with above mentioned requirement. 我想要一个能满足上述要求的简单的create react app。
currently I see: 目前我看到:
-- https://webpack.js.org/loaders/worker-loader/ -https://webpack.js.org/loaders/worker-loader/
-- https://github.com/GoogleChromeLabs/comlink -https://github.com/GoogleChromeLabs/comlink
-- https://github.com/GoogleChromeLabs/worker-plugin -https://github.com/GoogleChromeLabs/worker-plugin
can see the following link: https://github.com/arackaf/customize-cra/issues/137 可以看到以下链接: https : //github.com/arackaf/customize-cra/issues/137
example of usage: https://github.com/YumcoderCom/yumgram/blob/master/config-overrides.js 使用示例: https : //github.com/YumcoderCom/yumgram/blob/master/config-overrides.js
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.