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

Copy all non-svelte files to output directory #42

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

sndrs
Copy link
Collaborator

@sndrs sndrs commented May 2, 2023

What?

Copy all non-svelte files to output directory.

Why?

Allows users to structure their files as like.

Also useful for things like favicon.ico which should be at the root (unless otherwise specified).

so allow them to be anywhere, not just in `/assets`
Copy link
Owner

@mxdvl mxdvl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice.

Is there a risk of an infinite loop if the build directory happens to be nested inside the site directory?

src/build.ts Outdated Show resolved Hide resolved
Comment on lines +86 to +88
await copy(file.path, out_file, {
overwrite: true,
});
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could this lead to overwriting a file that has the same name as one of our outputs–e.g. index.html or islands.js? Might be worth ensuring that there’s no possible conflict.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah it could. what do you reckon is the best way to handle that? work out if it would and error with an explanation?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think a good error would be best. SvelteKit has a nice error for conflicting routes.

The "/(a)/conf" and "/(b)/conf" routes conflict with each other

@sndrs
Copy link
Collaborator Author

sndrs commented May 3, 2023

Nice.

Is there a risk of an infinite loop if the build directory happens to be nested inside the site directory?

ooh yeah, this is a good point, will fix that

Co-authored-by: Max Duval <[email protected]>
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

Successfully merging this pull request may close these issues.

2 participants