If you haven’t read about Shopify’s new theme development toolkit, Slate, check out the introductory post here. It provides you a starting set of files for developing your own custom Shopify theme along with handy build tools to speed up and optimize your workflow.
But what if you’re not starting from scratch? Whether you’re basing your work off an existing theme or supporting a client’s existing theme, there’s no doubt you’ve wanted to improve your development workflow at some point.
With Slate installed (
npm install -g @shopify/slate), you can run
slate migrate to convert an existing theme into the folder structure compatible with Slate.
Convert your theme with these steps:
- Navigate to your theme folder in your terminal of choice
- Run the migration command
- Follow the prompts to confirm the action. All valid Shopify theme folders from your root will be moved to the
- Create a private app and
config.ymlwith your store credentials to link your local environment with your shop. See Slate’s getting started page for these steps.
- Run Slate build or sync commands and build away
slate build after the migration will generate a
dist/ folder in your original root directory. These are the files that will be uploaded to your Shopify store and is a good way to test that the migration process went smoothly.
No you can use any of the Slate commands with your existing theme!
- If your root theme folder has a
src/directory for some reason the migration will fail. Rename that folder before trying again.
- If you already have a
package.jsonfile you’re working with an existing build system and you probably know better than this article