Skip to content

build: _routes.json is not regenerated by emptyOutDir: false. #260

@akku1139

Description

@akku1139

build and cloudflare-pages set the Vite build.emptyOutDir to false.
e125070

emptyOutDir: false,

This means that _routes.json is always in dist/,
so adding/removing files/directories to the public directory will not be applied to _routes.json.

// If _routes.json already exists, don't create it
if (paths.some((p) => p.name === ROUTES_JSON_NAME)) {
return
} else {

However, when generating a client, emptyOutDir: false. is required.
https://github.com/honojs/vite-plugins/blob/main/packages/build/README.md#build-a-client

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions