Skip to content

Change default publicDir in build JavaScript API #14122

@userquin

Description

@userquin

Description

When using build programatically, publicDir is enabled by default, that's, publicDir will be applied.

I was talking with @patak-dev about this.

Suggested solution

Split build adding a new variant or change the default publicDir to false.

Alternative

None: I'm preparing a PR to add a warning in the docs.

Additional context

For single builds there is no problem but using build in secondary build processes (meta frameworks or Vite plugins) can lead in unexpected side effects, for example:

In elk.zone repo, all public Nuxt 3 build assets were being overwritten after service worker build.

Validations

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions