A developer building a Theme App Extension block with React and webpack asks where to keep React source files, since deployment fails when extra directories are added beyond the default extension subfolders. They want to avoid cluttering the assets directory and find a top‑level repo folder unintuitive.
Suggested solution: colocate source code (e.g., in an extension-level src directory) and add a .shopifyignore file with an entry like “src/*” so the Shopify CLI ignores those files during deployment. This keeps sources near the extension, prevents deploy errors, and avoids bloating assets.
Reference: a linked Shopify CLI issue supports using .shopifyignore for this purpose. Outcome: a clear, actionable recommendation; no conflicting opinions shared, and the question appears resolved.
I’m building a theme app extension block using React and bundling with webpack. I’m curious if there is any best practice for where to store the React source files?
Deploying the extension throws an error if there are any added directories in addition to the default extension subdirectories and I don’t want to bloat the assets directory with source files. I’m currently storing them in a a top level directory but it feels unintuitive not to have them close to the related extension.
You don’t need to store them anywhere else. You can add .shopifyignore file instead and put something like “src/*” into it to ignore everything inside “src” directory (if your source files are located there)