andywer / andywer/threads.js

Importing function from package in same monorepo into worker file causes Webpack to run out of memory

未关闭
#323 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
TypeScript
星标
3.5k
派生
173
PR 合并指标
30 天内没有已合并 PR

描述

`FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory`

This doesn't happen with every single function from every single package, but it seems to be just about every.

We're importing from these packages in a non-circular manner, only importing the function we're using, and the package we're importing from has `sideEffects: false` set.

If we duplicate the function and put it in a file in the same directory as our `worker.js` file, no problems.

I'm guessing it's related to tree-shaking? Anyone have and ideas about a solution or a route of investigation for us to pursue?

Big thanks to @andywer for sharing this amazing project!

贡献指南

这个仓库没有索引到贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。