vite-plugins icon indicating copy to clipboard operation
vite-plugins copied to clipboard

fix(build): generate `_routes.json` based on public directory

Open yusukebe opened this issue 7 months ago • 3 comments

Fixes #260

yusukebe avatar May 30 '25 20:05 yusukebe

⚠️ No Changeset found

Latest commit: 3b101365965e7cba85439c4f5ac3f3f8226dd6da

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

changeset-bot[bot] avatar May 30 '25 20:05 changeset-bot[bot]

Thank you @yusukebe for working on #260.

I did some checks.

  • [x] Add/remove new files/directories to public/ and they will be added/removed to _routes.json .
  • [x] _routes.json is not regenerated by Vite if it is present in public/ .
  • [ ] When I delete a files/directories from public/, they will also be removed from dist. https://github.com/honojs/vite-plugins/issues/260#issuecomment-2846310270 In the example below, fixing this can cause problems. https://zenn.dev/yusukebe/articles/06d9cc1714bfb7

The last one can be a problem when _worker.js uses env.ASSETS.fetch().

akku1139 avatar May 31 '25 02:05 akku1139

@akku1139

Can you write a test for this?

When I delete a files/directories from public/, they will also be removed from dist.

yusukebe avatar May 31 '25 09:05 yusukebe