I’m using vite-plugin-shopify to generate optimized build files for my theme (JS, CSS, etc.). These build files are intentionally excluded from version control using both .gitignore and .shopifyignore, since I don’t want them tracked or synced globally.
I’m also using Shopify’s GitHub Integration to handle Liquid and JSON synchronization, which works well except for one issue:
The GitHub integration keeps restoring deleted/ignored build files, even though they’re in .shopifyignore and .gitignore.
This creates an annoying conflicts.
I’d love to set up a clean workflow where:
I ignore build files in GitHub and live theme (for cleanliness and repo clarity),
But still manually push the compiled assets via shopify theme push --only <file paths> from a GitHub Action during deploys.
Keep the GitHub integration enabled to sync Liquid and JSON files globally as usual.
But since .shopifyignore is unidirectional, and there’s no equivalent on the Online Store theme, I have no way to stop the GitHub integration from re-adding the build files.
Has anyone figured out a reliable way to combine a Vite build pipeline with the GitHub integration without losing control over these build assets? Would love to hear your approach or any ideas. Thanks!
Hey @devenini - hopefully I’m understanding correctly, but at the moment out Github integration does only support the “two way” sync between edits made in the Shopify admin and within the Github branch itself (more info here).
It’s not the most ideal, but one workaround you could try would be implementing Vite to build to a separate directory (e.g., dist/assets ) and use GitHub Actions to copy files only during deployment over to the “real” assets folder through that pipeline.
That said, I’m happy to put through a feature request for you for sure to see if we can enable easier version control, since you raise some great points. Let me know if I can set that up and I’d be happy to get that escalated
Unfortunately, the advices didn’t quite solve my use case. I think the issue is more about a lack of flexibility in the GitHub integration. It would be great if the .shopifyignore file was also respected by the Online Store. That way, if I copy or send files there, they wouldn’t get re-added to the Git repository.
You’re right that today the GitHub integration is two‑way and the Online Store doesn’t read .shopifyignore, so if those build artifacts exist in the theme they’ll be synced back to the repo. I’ve happy to go ahead file a feature request with our product team to explore honoring an ignore list from the Online Store side (or making .shopifyignore bidirectional) for sure though.
In the meantime, the cleanest path we’ve seen is building to a separate directory and pushing only the compiled assets during deploy via shopify theme push.
If you can share the exact paths you’d want excluded and a quick summary of your deploy flow, that can definitely help strengthen the feature request on our dev’s side of things. Appreciate you raising this, hope to hear from you soon!