Code Monkey home page Code Monkey logo

mygulpfile's Introduction

MyGulpConfig

Introduction

Here is my gulpfile that I use to develop my WordPress themes. You can use it as is or modify its configuration to adapt it to your project architecture.
Feel free to suggest improvements by creating issues or fork it !

 

Includes

This project includes lot of nodes module. Please read package.json and package-lock.json to check their own licenses.

 

Installation

  1. Install Node.js First, you need to install node.js on your system.
    Visit https://nodejs.org/

  2. Clone the repository

  3. Install dependencies of npm using npm i

  4. Configure browserSync Edit the file gulpfile.js at the root of the projet (lines 14 and 15) to setup the link and the port to use by browserSync like below.

const browserLink = 'http://localhost/'
const browserPort = 3030
  1. You're done
    Work in the /_src folder, all your changes will automatically be optimized and copied to the right place using the npx gulp command during development or npx gulp build to build your project.

I prefer to use package locally so I use npx to execute gulp. If you prefer to call gulp directly, install it globally : npm i -g gulp

 

Commandes

npx gulp

When developing, use browser sync to speed up your productivity. It'll compile the scss, prefixes it, quickly optimize images, minify scripts and copy PHP files to the good folder.

npx gulp build

Optimize your project before upload it ! It'll compile the scss, prefixes it, better optimize images (with an acceptable lossy compression), minify scripts and copy PHP files to the good folder.

npx gulp clean

For any reason you what to clean-up the project by delete build files. It will clear caching and delete all build files to just keep essential files and sources.

I prefer to use package locally so I use npx to execute gulp. If you prefer to call gulp directly, install it globally : npm i -g gulp

mygulpfile's People

Contributors

mrzyr0 avatar dependabot[bot] avatar

Stargazers

 avatar

Watchers

James Cloos avatar  avatar

mygulpfile's Issues

Browsersync crash on https

When trying to use BrowserSync with browserLink set with an https link, gulp crash :
Assertion failed: new_time >= loop->time, file c:\ws\deps\uv\src\win\core.c, line 309

It need certification setup

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.