BOLLB
Deno15mo ago
6 replies
BOLL

Run Fresh in subfolder with root deno.json

I'm using Fresh in a project where I have a big pile of other code in a separate folder. It works running the project if I have the deno.json file in the Fresh folder, but then formatting etc won't apply to code in the other folder.

Considering this, I am trying to get workspaces working, but I'm kind of stuck. If I make a root file and try to include Fresh as a workspace, the imports in it then fails due to not having been prefixed with ./ or ../, if I move the imports to the root deno.json I get an error that the Fresh deno.json requires imports to be in there to run at all, but then those would override the ones in the root. I'm getting very confused by all of this.

Is it even possible to have a Fresh instance as a workspace folder? I'm basically looking to do the below, and I'm struggling to keep my sanity:
/
├── deno.json
├── fresh/
│     ├── deno.json
│     └── main.ts
└── other/
      ├── deno.json
      └── main.ts

But yeah, I'm kind of at a moment 22 here and not sure how to get that to work. If possible I want to have separated imports between fresh and other, thus why it's split up like this, but again I'm struggling to actually get Fresh to work while in a workspace.
Was this page helpful?