Skip to content

Allow non-svelte files in layouts folder #177

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

Closed
jimafisk opened this issue Feb 3, 2022 · 1 comment
Closed

Allow non-svelte files in layouts folder #177

jimafisk opened this issue Feb 3, 2022 · 1 comment

Comments

@jimafisk
Copy link
Member

jimafisk commented Feb 3, 2022

Sometimes it would be helpful to include non .svelte files, like an SVG, in your layouts folder instead of putting them in your assets folder. Or maybe you want to include a simple .js helper, and while you could export this as a module in a Svelte file, there's no need to add processing time to the Svelte compiler. It would be nice if Plenti would simply copy these files over to the appropriate location in the public build folder. My only hesitation is when you offer more options, it invites an opportunity for conventions to become fuzzy.

@jimafisk
Copy link
Member Author

I can't remember exactly when we introduced this, but you should be able to include plain .js files in your layouts folder and the build will automatically copy them over so you can reference them in a svelte template. If you want to manipulate SVGs it probably makes sense to embed them in a svelte template or sub-component. For static files like PNGs, JPGs, etc, it makes the most sense to just put those in your media/ folder.

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

1 participant