Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Should allow apps that are in subdirectories #2022

Closed
maximedupre opened this issue Jul 27, 2021 · 3 comments
Closed

Should allow apps that are in subdirectories #2022

maximedupre opened this issue Jul 27, 2021 · 3 comments

Comments

@maximedupre
Copy link

maximedupre commented Jul 27, 2021

Describe the problem

We should be able to run svelte-kit dev from the root level and have the app in a subdirectory. E.g. /package.json and /my-app/src

This assumes that at a minimum package.json is at the root level so that packages are installed in the root node_modules and that you can run npm scripts when the root dir is your cwd.

The kit.paths.base and the kit.vite.root configurations do not accomplish this per my testing.

Describe the proposed solution

There should be a cli option or svelte.config.js param that would allow apps in subdirectories.

Alternatives considered

The alternative is:

  • cding in the subdirectory when you need to run commands
  • having 2 node_modules/package.json in your project (1 at root level and 1 in the subdir)

Importance

Would make my life easier

Additional Information

The context of this request is when you just want to supplement your current project with a svelte component.

Let's say I have an electron app and would like a svelte component to reside in a subdir at the root of the project.

@benmccann
Copy link
Member

you could do it with pnpm. that's how this repo is setup

@maximedupre
Copy link
Author

maximedupre commented Jul 28, 2021

you could do it with pnpm. that's how this repo is setup

Thanks for the suggestion. If I get too annoyed with constantly doing the alternative steps I mentioned in my OP and if svelte kit has not implemented this feature, I'll definitely give it a try.

For now I'll just wait.

I do think it should be a built-in feature as it seems pretty basic to me (I don't know about the implementation though).

@benmccann
Copy link
Member

You could also set all the files options: https://kit.svelte.dev/docs#configuration-files

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants