Path alias resolution breaks for certain paths in @sveltejs/package 2.3.8+ #13532
Labels
bug
Something isn't working
help wanted
PRs welcomed. The implementation details are unlikely to cause debate
pkg:svelte-package
Issues related to svelte-package
Describe the bug
Description
In version 2.3.8 and above of
@sveltejs/package
, certain path aliases are not being properly resolved during the packaging process. This worked correctly in version 2.3.7.The issue affects
.svelte.js
files, but is selective in which imports are transformed. Specifically, it appears that imports of files that re-export Svelte components are not being properly transformed to relative paths.Reproduction
Reproduction
When packaging a library with
svelte-package
, certain import paths in.svelte.js
files are not properly transformed to relative paths in the output.Source file (.svelte.js file):
Output with version 2.3.7 (works correctly):
Output with version 2.3.8 or higher (broken):
Note that in the same file, some imports are correctly resolved while others are not.
Key Observation
toSingleImageMeta
function is directly defined in the imported file, and its path is correctly transformedNetworkLoader
import refers to a file that re-exports a Svelte component:This suggests the issue might be related to how the package build tool traces dependencies through re-exports that involve Svelte components.
Environment
@sveltejs/package
: tested with 2.3.7 (working) vs 2.3.8+ (broken)Configuration
Workaround
For now, I've pinned my dependency to version 2.3.7:
I suspect this might be related to how paths that ultimately lead to Svelte components (even through re-exports) are handled differently in version 2.3.8+.
Logs
System Info
Severity
annoyance
Additional Information
No response
The text was updated successfully, but these errors were encountered: