Skip to content

[Bug]: theme dev doesn't sync files when using Vite with emptyOutDir: true #733

@gazjones00

Description

@gazjones00

Please confirm that you have:

  • Searched existing issues to see if your issue is a duplicate. (If you’ve found a duplicate issue, feel free to add additional information in a comment on it.)
  • Reproduced the issue in the latest CLI version.

In which of these areas are you experiencing a problem?

Theme

Expected behavior

When building with Vite while using the emptyOutDir flag, the Shopify CLI should delete and then update the newly compiled files.

Actual behavior

Currently, it only deletes them and requires you to rerun theme dev in order to update those files. Otherwise, it gets stuck, as you can see here

Screenshot 2022-11-07 at 22 52 12

Stack trace

No response

Reproduction steps

  1. Install shopify-cli@latest
  2. Install Vite and setup vite.config.js
  3. Set build.emptyOutDir: true
  4. Run vite build --watch --mode development
  5. Run theme dev --store X
  6. Change an input file referenced in Vite

Operating System

Mac OSX

Shopify CLI version (check your project's package.json if you're not sure)

3.22.0

Shell

zsh

Node version (run node -v if you're not sure)

v18.11.0

What language and version are you using in your application?

No response

Metadata

Metadata

Assignees

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