1 Star 0 Fork 0

lidh04/js-circle-chain-sdk

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
fixup 1.11 KB
一键复制 编辑 原始数据 按行查看 历史
lidh04 提交于 2024-11-24 08:06 . fix: the bug for common js module.
#!/bin/bash
cp -rf tools dist/
CJS_CREATE="
worker = new node_worker_threads_1.Worker(\`\${__dirname}/circle-miner-worker.js\`, { workerData: { threadCount, index, blockHeaderHexString, platform, arch }, });
"
echo $CJS_CREATE;
MJS_CREATE="
const filename = fileURLToPath(import.meta.url); const dirname = path.dirname(filename); worker = new Worker(\`\${dirname}/circle-miner-worker.js\`, { workerData: { threadCount, index, blockHeaderHexString, platform, arch }, });
"
echo $MJS_CREATE;
sed -ie 's|//WORKER_CREATION|worker = new node_worker_threads_1.Worker(\`\${__dirname}/circle-miner-worker.js\`, { workerData: { threadCount, index, blockHeaderHexString, platform, arch }, });|' ./dist/cjs/circle-miner.js
sed -ie 's|//WORKER_CREATION|const filename = fileURLToPath(import.meta.url); const dirname = path.dirname(filename); worker = new Worker(\`\${dirname}/circle-miner-worker.js\`, { workerData: { threadCount, index, blockHeaderHexString, platform, arch }, });|' ./dist/mjs/circle-miner.js
cat >dist/cjs/package.json <<!EOF
{
"type": "commonjs"
}
!EOF
cat >dist/mjs/package.json <<!EOF
{
"type": "module"
}
!EOF
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/lidh04/js-circle-chain-sdk.git
git@gitee.com:lidh04/js-circle-chain-sdk.git
lidh04
js-circle-chain-sdk
js-circle-chain-sdk
master

搜索帮助