Skip to content

Latest commit

 

History

History
24 lines (16 loc) · 1.71 KB

README.md

File metadata and controls

24 lines (16 loc) · 1.71 KB

Shopify Local Environment

This is a static-site generator which mimics the Shopify environment (as best as it can), using this local environment enables you to work on Shopify themes completely locally.

This isn't meant to mimic Shopify 100% because that's impossible, some objects Shopify gives you, e.g. current_tags, are based on the current URL or query string parameters, not to mention the AJAX API.

I created this to use when first starting on a new theme so you can write ~70% of the code here then when you need to use the more complicated Shopify stuff, move development environments to the actual Shopify one. So all the simple stuff like building the actual templates/CSS/JS is fast as it can be and we don't have to manually click the "refresh" button and re-download the page. When it comes to stuff like using special objects like current_tags or the AJAX API you should move on to the actual live Shopify development environment.

Requirements

  • Ruby (Download and run the installer from ruby-lang.org)
  • Node.js (Download and run the installer from nodejs.org)
  • Gulp (npm install --global gulp)
  • Liquid
  • libvips (brew install homebrew/science/vips)
  • Sharp (npm install sharp)

Installation

  1. Download or clone the repo
  2. Run the command: npm install
  3. Run the default Gulp task: gulp

The default Gulp task will build the site, start a local server and then launch a browser window with the site as the base. Files get watched for changes, if changed their corresponding task will run again, if your browser is on the local server, it will auto-refresh the pages too, so you can see the changes without having to manually refresh every time.