Skip to content

Conversation

csvn
Copy link
Contributor

@csvn csvn commented Sep 12, 2025

I have existing v1 Fresh projects that I was planning to upgrade to v2. But I was unsure about how to migrate, since I was using a src/ folder. By reading the source code, I found that with Vite, the root property can be used to select the root folder for all code.

This PR re-introduces the docs example for how to use a "src" folder from Fresh v1, but also adds a --src-dir option during init such that a project can be initialized with a src dir.

image

3. Update the `"start"` task in `deno.json` to the new `_fresh` location
```diff
- "start": "deno serve -A _fresh/server.js",
+ "start": "deno serve -A src/_fresh/server.js",
Copy link
Contributor

@fry69 fry69 Sep 12, 2025

Choose a reason for hiding this comment

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

Is it a good idea to put generated artifacts into the src/ folder? Even when those get gitignored, they do not belong there IMHO.

Copy link
Collaborator

@marvinhagemeister marvinhagemeister left a comment

Choose a reason for hiding this comment

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

I like this a lot! Wondering if we can find a way to put the _fresh directory at the top. It feels wrong to put it into src/

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.

3 participants