You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
luaBundle includes duplicate modules when using pnpm/yarn workspace symlinks #1683
When using luaBundle in a pnpm (or yarn) workspace monorepo, the same package gets bundled multiple times under different module keys if it's referenced both directly and transitively through symlinked dependencies.
Reproduction
Setup: pnpm workspace monorepo with three packages:
pkg-a — base library (buildMode: "library")
pkg-b — depends on pkg-a (buildMode: "library")
pkg-c — depends on pkg-a and pkg-b (luaBundle entry point)
____modules= {
["lua_modules.pkg-a.dist.index"] =function(...) -- direct dep from pkg-c-- ... pkg-a code ...end,
["lua_modules.pkg-b.node_modules.pkg-a.dist.index"] =function(...) -- transitive dep via pkg-b-- ... identical pkg-a code ...end,
}
Expected:pkg-a should appear only once in the bundle.
Root Cause
In src/transpilation/resolve.ts, the enhanced-resolve resolver is configured with symlinks: false (to preserve node_modules path detection). The deduplication in resolvedFiles and processedDependencies uses string-based path comparison. Since pnpm symlinks create different filesystem paths for the same physical file, the same module passes deduplication checks and gets bundled multiple times.
Activity