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
Describe the bug
I want to be able to develop some code that can be used by more than one website. So I want the contents of /routes to be populated with some real files but symlinked folders too.
I try to symlink a local folder into /routes/p and access a markdown file from that folder:
Logs
I get this error: Cannot find module 'svelte/internal' from '<my-project>/src/routes/p'
To Reproduce
I'm using a symlink on mac to link a folder into /routes/p
ln -s ~/path/to/markdown/folder ./src/routes/p
I'm using a very simple mdsvex config
/** @type {import('@sveltejs/kit').Config} */constconfig={extensions: [".svelte", ...mdsvexConfig.extensions],// Consult https://github.com/sveltejs/svelte-preprocess// for more information about preprocessorspreprocess: [preprocess({postcss: true,}),mdsvex(mdsvexConfig),],kit: {vite: {
......
Expected behavior
There should be a way to configure preserveSymlinks. I dug into the vite code and it looks like this is hardcoded to false unless running from pnp or something?
If I hardcode it to true instead of false, my code works.
Severity
I really want a way of putting .svelte/.css/.md files outside of /src to develop the implementation of the website separately from the content.
Additional context
I commented on mdsvex issues looking for an alternative solution to my problem.
The text was updated successfully, but these errors were encountered:
Can you file this issue in the Vite repo instead? Since the code you're referring to lives there I think that's where the code change would be necessary and there's not much we can do in SvelteKit
Describe the bug
I want to be able to develop some code that can be used by more than one website. So I want the contents of
/routes
to be populated with some real files but symlinked folders too.I try to symlink a local folder into
/routes/p
and access a markdown file from that folder:Logs
I get this error:
Cannot find module 'svelte/internal' from '<my-project>/src/routes/p'
To Reproduce
I'm using a symlink on mac to link a folder into
/routes/p
ln -s ~/path/to/markdown/folder ./src/routes/p
I'm using a very simple mdsvex config
Expected behavior
There should be a way to configure
preserveSymlinks
. I dug into the vite code and it looks like this is hardcoded to false unless running from pnp or something?If I hardcode it to true instead of false, my code works.
https://github.com/vitejs/vite/blob/8b5a6a855091e6f744cc7b886cf927d14dc74d50/packages/vite/src/node/utils.ts#L36-L49
Information about your SvelteKit Installation:
Diagnostics
Severity
I really want a way of putting
.svelte/.css/.md
files outside of /src to develop the implementation of the website separately from the content.Additional context
I commented on mdsvex issues looking for an alternative solution to my problem.
The text was updated successfully, but these errors were encountered: