Giter Site home page Giter Site logo

bveiga / simple-shopify-build-tool Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 19 KB

The absolutely simplest build tool for building and deploying your theme to your Shopify store. Engineered for minimum dependencies.

License: MIT License

JavaScript 100.00%

simple-shopify-build-tool's Introduction

Simple Shopify Build Tool

The absolutely easiest build tool for building and deploying your theme to your Shopify store.

Expected Project Structure

--project-folder/
  |--dist/ <-- this is the folder where files will go after a build
  |--src/
    |--assets/
    |--config/
    |--layout/
    |--locales/
    |--scripts/
    |--sections/
    |--snippets/
    |--styles/
    |--templates/

Setup

  1. Match your theme files to the expected project structure
  2. Copy the gulpfile into the root folder of your project
  3. Copy the package.json into the root folder of your project

NOTE: IF YOU ALREADY HAVE A package.json file for your project, simply copy the devDependencies section into your project's package.json

  1. Run npm install to install dependencies
  2. You're Ready to start developing and deploying.

Commands

Compile Files

gulp build

Detailed Explanation

This tool allows you to compile and deploy all your files to your Shopify theme. Here's what it does, in detail:

1. SASS Files

Reads each sass file in the root of the styles folder, and puts together files required using the @import sass function. Example file:

/*================ MODULES ================*/
@import './modules/header';

For the example above, let's say you have a theme.scss file in the root of the styles folder with the above code. The Gulp task would import all the files defined as above, compile the Sass, and create a new theme.css in the /dist/assets/ directory.

2. JS Files

Reads each JavaScript file in the root of the scripts folder, and concatenates files required using the // =require function (from the gulp-include library). Example file:

/*================ Sections ================*/
// =require sections/header.js

$(document).ready(function() {
	// some code
});

For the example above, let's say you have a file theme.js in the root of the scripts folder with the above code in it. That means the gulp task will look for a folder named sections, try to find a file named header.js in there, and then concatenate it into a new theme.js file that will go into the /dist/assets/ directory.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.