How to get custom folder structure with Fresh?
Hello, I want to integrate Fresh into my existing project. I want to use the 4 directories: components, routes, islands and static but I want them inside a directory in the project like
./src/fresh/
2 Replies
I could generate my own manifest and ignore the Fresh one but it seems like there's a better way
Sure, you can definitely change the source directory in your Fresh project. Here's how you can do it according to the documentation:
1. Move all your files, except
deno.json
and README.md
, to the src
directory (or any other directory of your choosing). In your case, you would move them to ./src/fresh/
.
2. Modify the start
task in deno.json
to point to the new directory. Here's what the diff of deno.json
might look like:
After these changes, your project structure would look like this:
And that's it! Your Fresh code now lives in the ./src/fresh/
directory. 🦕