This change updates zisi's node bundler to create missing symlinks in when archiveFormat: 'none' (the code path used by netlify dev).
Currently, in projects where two or more symlinks resolve to the same target, we only ever create one symlink. In practice, how this usually presents a problem is when a package manager dedupes a dependency by symlinking it into two different packages; users end up getting a runtime error when their code hits the code path that tries to resolve the missing symlink.
For example, given this scenario (which I took from a project that exhibits this issue):
...only the second symlink is created. This is because as we walk through the list of files to output to the build directory, we only track a single symlink destination per target. Many symlinks can point at the same target, though, so we need to track multiple symlink destinations per target.
I tested this out in my problem projects and it solved the problem. I took a stab at adding a test for this, but got a little lost in the test setup, which seems to have the .zip code path in mind rather than the 'none' path. Happy to write some tests if someone can point me at a test setup.
This change updates zisi's node bundler to create missing symlinks in when
archiveFormat: 'none'
(the code path used bynetlify dev
).Currently, in projects where two or more symlinks resolve to the same target, we only ever create one symlink. In practice, how this usually presents a problem is when a package manager dedupes a dependency by symlinking it into two different packages; users end up getting a runtime error when their code hits the code path that tries to resolve the missing symlink.
For example, given this scenario (which I took from a project that exhibits this issue):
...only the second symlink is created. This is because as we walk through the list of files to output to the build directory, we only track a single symlink destination per target. Many symlinks can point at the same target, though, so we need to track multiple symlink destinations per target.
I tested this out in my problem projects and it solved the problem. I took a stab at adding a test for this, but got a little lost in the test setup, which seems to have the
.zip
code path in mind rather than the'none'
path. Happy to write some tests if someone can point me at a test setup.