Skip to content

Watch for file changes in /public and build to /dist #4970

@iamrobreynolds

Description

@iamrobreynolds

Clear and concise description of the problem

As a developer using Vite I wish to --watch for changes to project files in /public (and/or any other root subdirectory) and transpose them to /dist upon change. This would speed up dev time and create a more efficient workflow when building for multiple platforms (ie: cms/ecommerce theme development) from a single codebase.

Suggested solution

During --watch, add an option in vite.config.js to specify directories to monitor for changes and possibly specify an argument for what to do with those files (transpile, transpose, etc).

Alternative

Coming from webpack, this would be a simple thing to add to webpack.config.js -> https://webpack.js.org/configuration/watch/

Additional context

Possibly somewhat related use-case... #3233 (comment)

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