comlink-loader Webpack加载器使用Comlink将模块卸载到Worker线程

说到把模块卸载到 Worker 线程,comlink-loader真的是一个挺好用的工具。它能让你几乎不改变代码的情况下,把大部分模块移到 Worker 中。支持几乎所有类、对象和函数,async/await的搭配也流畅。安装后,只需要做两步小改动,就能用它在 Worker 中导入类、实例化对象,简直不要太方便。哦,而且它还内置了代码拆分功能,Worker 会在需要时才加载,性能优化杠杠的。使用起来也蛮简单,推荐试试!

你只需运行npm install -D comlink-loader,在 Webpack 配置中加上相关内容,就可以通过comlink-loader把模块轻松卸载到 Worker 中。如果你对 Worker 和async/await有一些需求,使用这个工具会让你的开发更加高效。

zip
comlink-loader-master.zip 预估大小:13个文件
folder
comlink-loader-master 文件夹
file
.gitignore 112B
file
README.md 4KB
folder
test 文件夹
file
index.test.js 2KB
file
worker.js 937B
file
singleton.test.js 2KB
file
other.js 655B
file
LICENSE 11KB
file
package.json 2KB
file
CONTRIBUTING.md 1KB
folder
src 文件夹
file
comlink-worker-loader.js 882B
file
index.js 2KB
file
.travis.yml 141B
file
.editorconfig 188B
zip 文件大小:13.75KB