Commit Graph
1611 Commits
Author SHA1 Message Date
David Sherret a45cfe1ced fix(docs): export FreshViteConfig type (#3516)
For https://jsr.io/@fresh/plugin-vite/doc/~/fresh
2025-10-03 19:59:34 +02:00
fry69 8e9dcc087f docs: troubleshoot deploy error message (#3511)
This adds one sentence to the "My deployment won't start" section
mentioning the common `ISOLATE_INTERNAL_FAILURE` error message, so it
can get found via search.

See also discussion in Discord ->
https://discord.com/channels/684898665143206084/1422792167797166121
2025-10-02 23:47:48 +02:00
fry69 1e94e1c9c5 docs: troubleshoot VS Code extension (#3510)
This adds a short blurb how to install the VS Code extension to the
troubleshooting guide.

Possible concerns:
- maybe redundant as there are already official VS Code Deno docs
- could be shortened to just refer to the main docs or completely
removed
2025-10-01 13:20:47 +02:00
fry69 89ae0935b6 docs: troubleshoot dependency installation (#3508)
This adds:
- a short blurb about missing dependencies to the troubleshooting guide
- a hint to this guide in the getting starting page
2025-09-30 11:32:37 +02:00
Marvin Hagemeister 63dd77a319 fix(vite): dev server not recovering on syntax error (#3507)
Fixes https://github.com/denoland/fresh/issues/3506
2025-09-29 19:03:02 +02:00
Jade bff711411d docs: update readme for fresh 2 (#3503)
The current version of the README is misleading, because:

1. The build instructions result in a Fresh v1.0 project.
2. Since Fresh v2.0, Fresh no longer does JIT rendering on the edge.
2025-09-27 17:58:34 +02:00
Bruno Bernardino fa6f4f4bef docs: fix wrong variable name in migration guide (#3496)
You have `export const handlers = ` when it needs to be `export const
handler = `.

I'm unsure if there's any build process I need to run for this.
2025-09-26 11:03:42 +02:00
fry69 1c1ea06138 ci: fix publish workflow (#3495)
Looks like the `publish.yml` workflow also needs a `deno install` step,
the current one fails with missing types, see here ->
https://github.com/denoland/fresh/actions/runs/18017720086/job/51266850091#step:4:6

I have no clue why the `deploy.yml` workflow failed with `vite: command
not found` (see here ->
https://github.com/denoland/fresh/actions/runs/18017526863/job/51266206092?pr=3493#step:4:6).
That should work IMHO.
2025-09-25 22:47:14 +02:00
fry69andMarvin Hagemeister f7a2422e93 fix: set nodeModulesDir to manual (#3493)
Hopefully a less invasive fix for #3378

---------

Co-authored-by: Marvin Hagemeister <hello@marvinh.dev>
2025-09-25 20:54:27 +02:00
fry69 f82bd7e63d docs: add deno.json update section to migration guide (#3471)
fix #3470 

This adds a short blurb about `deno.json` focusing on imports.

Background: Without `npm:vite` and `jsr:@fresh/plugin-vite` installed it
can lead to confusing errors like this one:
```shell
$ deno task dev
vite: command not found
```

Which might lead to users install Vite globally, which is not needed
(and will not fix this problem).
2025-09-20 13:17:11 +02:00
Marvin Hagemeister 5c05d6533f chore: release 2.1.1 (#3466)
- @fresh/core@2.1.1
- @fresh/update@2.1.1
- @fresh/plugin-vite@1.0.4
2025-09-19 20:27:35 +02:00
Marvin Hagemeister 9b83a1e1b3 fix(vite): cover more commonjs cases (#3465)
Fixes https://github.com/denoland/fresh/issues/3463
Fixes https://github.com/denoland/fresh/issues/3449
2025-09-19 18:36:51 +02:00
Marvin Hagemeister a6016fc045 showcase: remove paquet (#3462)
Fixes https://github.com/denoland/fresh/issues/3460
2025-09-19 10:15:10 +02:00
Marvin Hagemeister 69ad9bc3c1 fix(vite): improve cjs esm detection + builtins resolution (#3457) 2025-09-16 19:41:22 +02:00
Mau Scheff 18961995d5 docs: Revise migration guide with new help sections (#3455)
Revise migration guide with new help sections
2025-09-16 13:24:39 +02:00
fry69 e5a3a99e96 fix: update command message (#3452)
fix #3451
2025-09-16 12:24:17 +02:00
Marvin Hagemeister 9a2098ecba fix(vite): ensure plugins are only instantiated once (#3450)
This makes debugging a lot easier as by default vite instantiates
plugins multiple times for each environment.
2025-09-16 11:35:00 +02:00
Marvin Hagemeister b9d550fef8 docs: fix slugs shared across all pages (#3448)
The slugger was shared across all pages and it assumes each passed value
should be unqiue. Due to that it would append additional numbers to the
id value.
2025-09-16 09:50:23 +02:00
Marvin Hagemeister cc95155047 fix: returned handler headers only working with plain objects (#3447)
We only dealt with returned headers as objects instead of all potential
shapes of `Headersinit`.

Fixes https://github.com/denoland/fresh/issues/3445
2025-09-16 09:45:11 +02:00
15067345ed chore: resolve resource leak in www/main_test.ts (#3428)
The `buildVite` function returns a disposable object which was not being
properly disposed of, leading to a resource leak warning in the test
suite.

This change wraps the tests in `www/main_test.ts` in an async function
and uses `await using` to ensure that the temporary directory created by
`buildVite` is cleaned up after the tests complete.

---------

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
Co-authored-by: Marvin Hagemeister <marvin@deno.com>
Co-authored-by: Emil Krebs <68400102+emilkrebs@users.noreply.github.com>
Co-authored-by: Marvin Hagemeister <hello@marvinh.dev>
2025-09-15 22:31:07 +02:00
Marvin Hagemeister de9b8a7c40 chore: release 2.1.0 (#3443)
- @fresh/core@2.1.0
- @fresh/plugin-vite@1.0.3
- @fresh/update@2.1.0
- @fresh/init@2.0.9
2025-09-15 19:29:04 +02:00
Marvin Hagemeister 78b886d397 chore: fix non-prerelease version in release script (#3442) 2025-09-15 19:19:44 +02:00
Marvin Hagemeister 3867e60664 fix: improve missing build cache error message (#3441)
Hoping that this helps folks who ignore the migration guide and keep the
entry pointed to `main.ts`.
2025-09-15 19:19:10 +02:00
fry69 999b89501e docs: fix testing docs (#3419)
This fixes the testing page in the docs for real this time.

Every test is hand checked now. Thanks to a certain button, which
appeared recently.

Optionally I can also split this page up in separate pages:
- Middlewars
- AppWrappers and Layouts
- Routing and Handlers
- SSR and Islands
2025-09-15 16:53:48 +00:00
Marvin Hagemeister 399cbc3aa2 fix(vite): nested islands not working (#3440)
This PR makes nested islands work. Problem was that only entry files
have the `src` property in the vite manifest. For that we need to ensure
that every island is an entry point.

Fixes https://github.com/denoland/fresh/issues/3439
2025-09-15 17:55:44 +02:00
Marvin Hagemeister 3fb3cd9443 fix(vite): route css import (#3438)
Fixes https://github.com/denoland/fresh/issues/3426
2025-09-15 13:20:07 +02:00
fry69 016f94e28e docs: fix minor issues in middleware docs (#3436) 2025-09-15 12:20:48 +02:00
Emil KrebsandMarvin Hagemeister b4bb004753 feat: add CSP and header middleware (#3421)
Added a CSP and header middleware to simplify the HTTP Security Response
Header creation.

Fixes:
- https://github.com/denoland/fresh/issues/1705

Example:

```ts
// main.ts

export const app = new App<State>()
    .use(csp({
        reportTo: '/api/csp-reports',
    }))
    .use(headers({
        'Cross-Origin-Resource-Policy': 'same-site',
        'Cross-Origin-Embedder-Policy': 'require-corp',
        'Cross-Origin-Opener-Policy': 'same-origin',
        'Permissions-Policy':
            'geolocation=(), camera=(), microphone=(), payment=(), usb=(), bluetooth=(), magnetometer=(), gyroscope=(), accelerometer=()',
        'Referrer-Policy': 'strict-origin-when-cross-origin',
        'X-Content-Type-Options': 'nosniff',
        'X-Frame-Options': 'DENY',
        'Strict-Transport-Security': 'max-age=63072000; includeSubDomains; preload',
    }))
```

Endpoint example:
```ts
// routes/api/csp-handler.ts

import { Context } from 'fresh';
import { State } from '../../main.ts';

export const handler = {
    async POST(ctx: Context<State>) {
        try {
            const text = await ctx.req.text();
            const body = JSON.parse(text);

            const logEntry = {
                timestamp: new Date().toISOString(),
                report: body,
                userAgent: ctx.req.headers.get('user-agent') || 'unknown',
            };
            await Deno.writeFile('csp-reports.log', new TextEncoder().encode(JSON.stringify(logEntry) + '\n'), { append: true });

            return new Response(JSON.stringify({ status: "ok" }), { status: 200 });
        } catch (error) {
            console.error("Error handling CSP report:", error);
            return new Response(JSON.stringify({ status: "error", error: String(error) }), { status: 500 });
        }
    },
};

```

Implementing these headers improved the security report at [Security
Headers](securityheaders.com) from F to A and helps to prevent security
vulnerabilities like Cross-Site Scripting and Clickjacking.

**Before**
<img width="1200" height="308" alt="image"
src="https://github.com/user-attachments/assets/01adfff4-5bb4-4cc6-bd8f-5e74b471301b"
/>
**After**
<img width="1200" height="335" alt="image"
src="https://github.com/user-attachments/assets/c5a9b07e-babf-4797-b47d-4368de70cbc3"
/>

---------

Co-authored-by: Marvin Hagemeister <marvin@deno.com>
2025-09-15 12:20:22 +02:00
Marvin Hagemeister f9ba5417c4 fix: bring back support for middleware Array (#3434)
Our validation didn't account for `_middleware` files exporting an Array
of middlewares.

Fixes https://github.com/denoland/fresh/issues/3400
2025-09-15 10:44:21 +02:00
Marvin Hagemeister b31f36265c fix(vite): keep require calls in ESM file (#3433)
Detect if a file is ESM based on file extension or finding ESM-only
statements. When we know that it's an ESM file we should keep
`require()` calls as is, because some libraries use it as a conditional
check like `npm:motion`.

Fixes https://github.com/denoland/fresh/issues/3429
2025-09-15 10:40:09 +02:00
fry69andgoogle-labs-jules[bot] a12e20d992 fix(init): correct temporary directory creation in tests (#3425)
The tests for the `init` package were failing with a `PermissionDenied`
error in Jules container environment when creating temporary
directories. This was because the tests were attempting to create the
temporary directories in the root of the project, where permissions are
often restricted.

This change corrects the issue by removing the local `withTmpDir` helper
function in `packages/init/src/init_test.ts` and instead using the one
from `../../fresh/src/test_utils.ts`. The shared helper function
correctly creates temporary directories in the operating system's
default temporary directory, which resolves the permission issue.

Sample error message from Jules before this fix:

```
 ERRORS 

init - new project => ./packages/init/src/init_test.ts:99:6
error: PermissionDenied: Permission denied (os error 13): tmpdir
  const dir = await Deno.makeTempDir(options);
                         ^
    at Object.makeTempDir (ext:deno_fs/30_fs.js:168:10)
    at withTmpDir (file:///app/packages/fresh/src/test_utils.ts:136:26)
    at withTmpDir (file:///app/packages/init/src/init_test.ts:41:10)
    at file:///app/packages/init/src/init_test.ts:100:27

init - create project dir => ./packages/init/src/init_test.ts:107:6
error: PermissionDenied: Permission denied (os error 13): tmpdir
  const dir = await Deno.makeTempDir(options);
              ^
    at async withTmpDir (file:///app/packages/fresh/src/test_utils.ts:136:15)
    at async file:///app/packages/init/src/init_test.ts:108:21

init - with tailwind => ./packages/init/src/init_test.ts:122:6
error: PermissionDenied: Permission denied (os error 13): tmpdir
  const dir = await Deno.makeTempDir(options);
                         ^
    at Object.makeTempDir (ext:deno_fs/30_fs.js:168:10)
    at withTmpDir (file:///app/packages/fresh/src/test_utils.ts:136:26)
    at withTmpDir (file:///app/packages/init/src/init_test.ts:41:10)
    at file:///app/packages/init/src/init_test.ts:123:27

init - with vscode => ./packages/init/src/init_test.ts:140:6
error: PermissionDenied: Permission denied (os error 13): tmpdir
  const dir = await Deno.makeTempDir(options);
              ^
    at async withTmpDir (file:///app/packages/fresh/src/test_utils.ts:136:15)
    at async file:///app/packages/init/src/init_test.ts:141:21

init - fmt, lint, and type check project => ./packages/init/src/init_test.ts:153:6
error: PermissionDenied: Permission denied (os error 13): tmpdir
  const dir = await Deno.makeTempDir(options);
              ^
    at async withTmpDir (file:///app/packages/fresh/src/test_utils.ts:136:15)
    at async fn (file:///app/packages/init/src/init_test.ts:159:23)

init with tailwind - fmt, lint, and type check project => ./packages/init/src/init_test.ts:179:6
error: PermissionDenied: Permission denied (os error 13): tmpdir
  const dir = await Deno.makeTempDir(options);
              ^
    at async withTmpDir (file:///app/packages/fresh/src/test_utils.ts:136:15)
    at async file:///app/packages/init/src/init_test.ts:182:23

init - can start dev server => ./packages/init/src/init_test.ts:205:6
error: PermissionDenied: Permission denied (os error 13): tmpdir
  const dir = await Deno.makeTempDir(options);
              ^
    at async withTmpDir (file:///app/packages/fresh/src/test_utils.ts:136:15)
    at async fn (file:///app/packages/init/src/init_test.ts:211:23)

init - can start built project => ./packages/init/src/init_test.ts:233:6
error: PermissionDenied: Permission denied (os error 13): tmpdir
  const dir = await Deno.makeTempDir(options);
              ^
    at async withTmpDir (file:///app/packages/fresh/src/test_utils.ts:136:15)
    at async file:///app/packages/init/src/init_test.ts:234:21

init - errors on missing build cache in prod => ./packages/init/src/init_test.ts:265:6
error: PermissionDenied: Permission denied (os error 13): tmpdir
  const dir = await Deno.makeTempDir(options);
                         ^
    at Object.makeTempDir (ext:deno_fs/30_fs.js:168:10)
    at withTmpDir (file:///app/packages/fresh/src/test_utils.ts:136:26)
    at withTmpDir (file:///app/packages/init/src/init_test.ts:41:10)
    at file:///app/packages/init/src/init_test.ts:266:27

init - with vite => ./packages/init/src/init_test.ts:348:6
error: PermissionDenied: Permission denied (os error 13): tmpdir
  const dir = await Deno.makeTempDir(options);
                         ^
    at Object.makeTempDir (ext:deno_fs/30_fs.js:168:10)
    at withTmpDir (file:///app/packages/fresh/src/test_utils.ts:136:26)
    at withTmpDir (file:///app/packages/init/src/init_test.ts:41:10)
    at file:///app/packages/init/src/init_test.ts:349:27

 FAILURES 

init - new project => ./packages/init/src/init_test.ts:99:6
init - create project dir => ./packages/init/src/init_test.ts:107:6
init - with tailwind => ./packages/init/src/init_test.ts:122:6
init - with vscode => ./packages/init/src/init_test.ts:140:6
init - fmt, lint, and type check project => ./packages/init/src/init_test.ts:153:6
init with tailwind - fmt, lint, and type check project => ./packages/init/src/init_test.ts:179:6
init - can start dev server => ./packages/init/src/init_test.ts:205:6
init - can start built project => ./packages/init/src/init_test.ts:233:6
init - errors on missing build cache in prod => ./packages/init/src/init_test.ts:265:6
init - with vite => ./packages/init/src/init_test.ts:348:6

FAILED | 449 passed (14 steps) | 10 failed | 17 ignored (2m38s)
```

---------

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
2025-09-14 11:44:47 +02:00
Marvin Hagemeister 4cc0722465 chore: release 2.0.2 (#3418)
- @fresh/core@2.0.2
- @fresh/plugin-vite@1.0.2
- @fresh/update@2.0.2
- @fresh/init@2.0.8
2025-09-12 19:16:12 +02:00
Marvin Hagemeister 3ff4ec2ccb chore: make less test less flaky (#3417) 2025-09-12 18:22:21 +02:00
Marvin Hagemeister ae3db58a99 fix(vite): .env files not being loaded (#3416)
Fixes https://github.com/denoland/fresh/issues/3364
2025-09-12 18:21:51 +02:00
LachandMarvin Hagemeister dd41a8706b fix(vite): exclude packages from deno cache in prefresh (#3374)
When disabling `node_modules` directory in Deno, prefresh plugin
transforms files in ~/.cache/deno/npm/registry.npmjs.org/ directory,
causing an arcane error to occur:
https://github.com/preactjs/prefresh/issues/124

After disabling this transform my site now works on updated fresh
version

I'm not sure if is the correct way to exclude this, but I don't see any
longer pattern that would work here

The cache is stored in $XDG_CACHE_HOME/deno/npm/$REGISTRY_HOST, where
only deno/npm part seems to be static

---------

Co-authored-by: Marvin Hagemeister <marvin@deno.com>
2025-09-12 18:17:36 +02:00
Zhi 7999d500f8 docs: fix missing files on "sharing state with islands" page (#3377)
close #3376
2025-09-12 17:16:30 +02:00
Marvin Hagemeister 169f156f78 fix(init): incorrect target dir argument (#3415)
Fixes https://github.com/denoland/fresh/issues/3413
2025-09-12 15:37:06 +02:00
Marvin Hagemeister 8a996a428a fix(vite): missing build id in Deno Deploy EA (#3414)
Fixes https://github.com/denoland/fresh/issues/3282
2025-09-12 15:24:26 +02:00
Marvin Hagemeister e06f03ac67 fix: add missing compile entry (#3410)
Fixes https://github.com/denoland/fresh/issues/3409
2025-09-12 13:08:49 +02:00
Marvin Hagemeister 7ce6aeff8b fix(vite): workaround for FOUC with tailwind (#3407)
Fixes https://github.com/denoland/fresh/issues/3379
2025-09-12 12:34:23 +02:00
Marvin Hagemeister e5bc9194e9 fix(vite): drop trailing or leading whitespace in build id (#3408)
Fixes https://github.com/denoland/fresh/issues/3406
2025-09-12 12:33:13 +02:00
Marvin Hagemeister 0e6bddd06e chore: release 2.0.1 (#3404)
- @fresh/core@2.0.1
- @fresh/plugin-vite@1.0.1
- @fresh/update@2.0.1
- @fresh/init@2.0.7
2025-09-12 11:05:03 +02:00
Marvin Hagemeister fc3cdc9588 docs: update cloudflare workers docs (#3405) 2025-09-12 11:04:47 +02:00
Marvin Hagemeister e30cb375d1 docs: mention entry in cloudflare worker docs (#3403)
Related https://github.com/denoland/fresh/issues/3402
2025-09-12 10:37:38 +02:00
fry69 3010e27097 fix: add basePath support in mountApp() (#3395)
Fix for mountApp() with the new basePath handling

---
Generated PR message:

I successfully investigated and implemented a fix for mountApp() to make
it compatible with basePath handling. Here's what I found and fixed:

  The Problem

The original mountApp() implementation completely ignored the inner
app's basePath. When mounting an app like this:

```ts
  const innerApp = new App({ basePath: "/api" })
    .get("/users", () => new Response("users"));

  const app = new App()
    .mountApp("/v1", innerApp);
```

The route would become /v1/users instead of the expected /v1/api/users
because the inner app's /api basePath was lost.

  Root Cause

The issue was in the mountApp() method at packages/fresh/src/app.ts:333.
The original code only used:

```ts
  pattern: mergePath(path, cmd.pattern, true)
```

This only considered the mount path (/v1) and the command pattern
(/users), but ignored app.config.basePath (/api).

  The Fix

I modified the mountApp() method to properly handle the inner app's
basePath:

```ts
  // Apply the inner app's basePath if it exists
  let effectivePattern = cmd.pattern;
  if (app.config.basePath) {
    effectivePattern = mergePath(app.config.basePath, cmd.pattern, false);
  }

  const clone = {
    ...cmd,
    pattern: mergePath(path, effectivePattern, true),
    includeLastSegment: cmd.pattern === "/" || cmd.includeLastSegment,
  };
```

The key insight was to only apply the basePath transformation when the
inner app actually has a basePath (not empty), which preserves backward
  compatibility with existing code that doesn't use basePath.

  Test Coverage

  I added comprehensive test cases covering:

1. Inner app with basePath: /v1 + /api basePath + /users route =
/v1/api/users
2. Main app with basePath + mounted app: /main basePath + /sub mount +
/data route = /main/sub/data
3. Both main and inner basePath: /main + /services + /api/v2 + /users =
/main/services/api/v2/users

  Backward Compatibility

  The fix maintains full backward compatibility:
  - ✅ All existing mountApp() tests pass
  - ✅ All existing basePath tests pass
  - ✅ New functionality works as expected

  Now the three basePath mechanisms work correctly together:

  1. Vite base config → Static asset URLs
  2. App basePath option → Route matching (now works with mountApp!)
  3. External mounting → Framework integration

The solution correctly handles the scenario you described where
vite.config.ts, main.ts, and external mounting all work together
seamlessly.
2025-09-12 10:06:06 +02:00
Christian Svensson 6466c975d5 fix: show help text and refresh help formatting (#3399)
- Show help text when `-h` or `--help` is passed to `@fresh/init`
- Print current version for `@fresh/init` during `--help`
<img width="367" height="95" alt="image"
src="https://github.com/user-attachments/assets/e3318fae-ce8a-4cbb-bb0a-78f338f1b3a2"
/>
- Refresh `--help` text with colors similar to `deno -h`; + "Fresh
branding" style for the `@fresh/init` text
- Print `@fresh/core` version when `@fresh/init` runs
<img width="471" height="88" alt="image"
src="https://github.com/user-attachments/assets/1a0bd619-315d-4abb-889c-ec6eb3a9b45f"
/>

I think showing versions is helpful for verifying/debugging what Fresh
version will be installed during init before all files are generated.

## Comparisons

### `@fresh/init` + empty project name

#### Before

<img width="1104" height="615" alt="image"
src="https://github.com/user-attachments/assets/b1534bb5-eecc-4692-9977-df3903868416"
/>

#### After

<img width="1169" height="695" alt="image"
src="https://github.com/user-attachments/assets/6a743d79-bb59-463a-aadd-fbf734149258"
/>

### `@fresh/init --help`

#### Before

<img width="1007" height="150" alt="image"
src="https://github.com/user-attachments/assets/0ad42078-420c-4dc6-9561-4a338cc09741"
/>

#### After

<img width="1272" height="579" alt="image"
src="https://github.com/user-attachments/assets/3dfe6712-8604-4429-a418-5e6538117303"
/>
2025-09-12 10:04:54 +02:00
fry69 a473cc9d9f docs: update testing with routes and islands (#3385)
closes #3383
2025-09-12 10:03:08 +02:00
Marvin Hagemeister 9581d7e6d4 fix(vite): remove Deno global check (#3401)
Ultimately, it causes more problems than it solves.
2025-09-12 10:01:37 +02:00
Christian Svensson c22c20e21f docs: avoid showing "Copied" if copying fails (#3397)
I noticed that in denoland/fresh#3393 it looks like it's possible that
the "Copied"/Check icon will be shown even if copying to clipboard
fails.

This PR changes it so that the Check icon only shows if copy succeeds.
2025-09-11 21:37:31 +02:00
fry69 6fbe0ddcc4 fix(vite): basePath handling for static assets (#3394)
closes #3391 

---
Generated PR message:

Fix base path handling for assets in plugin-vite

Fixes issue where Fresh apps mounted at non-root paths (e.g., /ui) in
frameworks like Hono would fail to load assets correctly.

  Problem

When mounting a Fresh app with app.mount('/ui', UI.fetch), the HTML
would load but all assets (CSS, JS, images) would return 404 because
asset paths
were hardcoded to start with /assets/ instead of respecting the Vite
base configuration.

  Solution

- Modified packages/plugin-vite/src/plugins/server_entry.ts to read
Vite's base config and apply it to asset paths
- Added getAssetPath() helper function to construct proper asset URLs
with base path
  - Updated both CSS and asset file registration to use the base path

  Testing

Added comprehensive test case "vite build - base path asset handling"
that:
  - Builds demo with custom base path /my-app/
  - Verifies generated server.js contains correctly prefixed asset paths
  - Follows existing test patterns and utilities

  Usage

  Users can now properly mount Fresh apps by configuring both:
```ts
  // vite.config.ts
  export default defineConfig({
    base: "/ui/",
    plugins: [fresh()],
  });

  // main.ts  
  const app = new App({ basePath: "/ui" });

  // hono-app.ts
  app.mount('/ui', UI.fetch); // Assets now work correctly
```

  Backward compatible - no changes needed for apps mounted at root path.
2025-09-11 16:07:15 +02:00