Describe the bug
If I have two sveltekit apps:
monorepo_root/
├─ application/
│ ├─ foo.js
├─ library/
│ ├─ lib/
│ │ ├─ bar.js
and I import from '$lib/bar.js' in component, it works in isolation, for instance if I run the sveltekit app inside library, but if component is a component linked to app, component' reference to $lib points to app's $lib instead.
System Info
System:
OS: Linux 5.8 Ubuntu 20.10 (Groovy Gorilla)
CPU: (8) x64 AMD Ryzen 7 4700U with Radeon Graphics
Memory: 8.89 GB / 30.85 GB
Container: Yes
Shell: 5.8 - /bin/zsh
Binaries:
Node: 16.13.0 - ~/.volta/tools/image/node/16.13.0/bin/node
Yarn: 1.22.10 - ~/.volta/tools/image/yarn/1.22.10/bin/yarn
npm: 8.1.0 - ~/.volta/tools/image/node/16.13.0/bin/npm
Browsers:
Brave Browser: 96.1.32.106
Chrome: 96.0.4664.45
Chromium: 96.0.4664.45
Firefox: 90.0
npmPackages:
@sveltejs/kit: next => 1.0.0-next.196
svelte: ^3.42.6 => 3.44.1
Severity
makes monorepo development impractical
serious, but I can work around it.
Additional Information
I can work around it by falling back to ../../...
However, this is fairly impractical, so I think aliasing $lib always to the local project somehow is the optimal fix.
Describe the bug
If I have two sveltekit apps:
and I import from '$lib/bar.js' in component, it works in isolation, for instance if I run the sveltekit app inside
library, but if component is a component linked to app, component' reference to$libpoints to app's$libinstead.System Info
System: OS: Linux 5.8 Ubuntu 20.10 (Groovy Gorilla) CPU: (8) x64 AMD Ryzen 7 4700U with Radeon Graphics Memory: 8.89 GB / 30.85 GB Container: Yes Shell: 5.8 - /bin/zsh Binaries: Node: 16.13.0 - ~/.volta/tools/image/node/16.13.0/bin/node Yarn: 1.22.10 - ~/.volta/tools/image/yarn/1.22.10/bin/yarn npm: 8.1.0 - ~/.volta/tools/image/node/16.13.0/bin/npm Browsers: Brave Browser: 96.1.32.106 Chrome: 96.0.4664.45 Chromium: 96.0.4664.45 Firefox: 90.0 npmPackages: @sveltejs/kit: next => 1.0.0-next.196 svelte: ^3.42.6 => 3.44.1Severity
makes monorepo development impractical
serious, but I can work around it.
Additional Information
I can work around it by falling back to
../../...However, this is fairly impractical, so I think aliasing
$libalways to the local project somehow is the optimal fix.