Code Monkey home page Code Monkey logo

gulp-dev-wordpress's Introduction

Gulp File

Requirements

  • Node.js > 6.9
  • Gulp.js > 3.9

How to use

Copy this folder into the same directory with your theme. Install all the denpendencies. Then you need to update the theme name in gulpfile.js

...
  var themename = 'Your-Theme-Name'
...

And Browsersync config to your choice.

From the command line on your host machine, navigate to the gulp-dev directory then run

$ gulp

If you are using VS Code you can use builtin gulp-task

You can run your task through Quick Open (⌘P) by typing 'task', Space and the command name.

Please refer to VS Code documentation for more details.

Install dependencies

From the command line on your host machine, navigate to the gulp-dev directory then run

$ npm install

Build Commands

  • gulp styles — Compile, autoprefix and minify Sass files.
  • gulp scripts — Minify javascript files.
  • gulp images — Compress and optimize images.
  • gulp watch — Compile assets and watch file changes with Browsersync
  • gulp — (Default task) runs all of the above tasks.

Additional commands

  • gulp i18n — Scan the theme and create POT file.
  • gulp zip — Package theme into zip file for distribution.
  • gulp bump - Bumps version number in all files. See options below.
    • --major version when you make incompatible API changes
    • --minor version when you add functionality in a backwards-compatible manner
    • --patch version when you make backwards-compatible bug fixes
    • --to allows you to define a custom version number, e.g. gulp bump --to 0.1.0

Using Browsersync

To use Browsersync you need to update the proxy URL in gulpfile.js under watch task to reflect your local development hostname.

If your local development URL is my-site, update the file to read:

...
  proxy: 'localhost/my-site',
...

You can also update to use your favorious browser. For instance, I'm using Firefox Developer on Mac OS so I need to update the path to my app under applications folder. For more information check out BrowserSync documentation

...
browser: '/Applications/Firefox\ Developer\ Edition.app'
...

License

This project is licensed under the MIT License - see the LICENSE.md file for details.

gulp-dev-wordpress's People

Contributors

tkan145 avatar

Watchers

James Cloos avatar  avatar

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.