Giter Site home page Giter Site logo

one-gulp's Introduction

one-gulp

[WIP] a ready to use set of gulp tasks

install

If your're starting a new project, you just need to run this :

npm install gulp one-gulp --save

This will install gulp and the one-gulp node module. If you don't have a gulpfile.js in your project, it will generate one with the minimum configuration.

init

If you're already using gulp, you need to install the one-gulp node module by running this :

npm install one-gulp --save

and then you'll be able to init one-gulp with this code :

var gulp = require('gulp'),
    one = require('one-gulp');

one.init(gulp, {
    // look at options documentation for details
});

The one.init() function adds several tasks to your gulp :

  • serve
  • watch
  • writeToDev
  • writeToProd
  • browserSync
  • graph

config options

src

tmp

dest

connectPort

browserSyncPort

bindHost

sortDeps // relative to src

Remote debugging

Using browser's tools

Chrome, Firefox, Opera and Safari provide remote debugging for their latest desktop and mobile browsers :

Using weinre

If you need to remote debug older versions of the above browsers, Internet Explorer or a WebView, you'll have to use weinre.

one-gulp uses BrowserSync, so weinre is already installed. You just need to add a target script in your pages and enable the debug interface.

Manual target script injection

If you want weinre to work, you can manually add a target script like this in your pages :

<script src="//[your-local-IP]:[options.weinrePort]/target/target-script-min.js#browsersync"></script>

Automatic target script injection

You can also set options.injectWeinreSnippet to true to automatically inject the weinre target script in your pages. This will only work on the BrowserSync port.

Enable the debugger

By default, after starting the servers, weinre is disabled. To enable it, just follow these two steps :

  1. Open http://[your-local-ip]:[browser-sync-conf-port]/remote-debug and enable Remote Debugger (weinre).
  2. Click on the Access remote debugger (opens in a new tab).

one-gulp's People

Contributors

fclaeys avatar hsablonniere avatar mghignet avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

one-gulp's Issues

fix inject sort

filterAndSort seems to reorder files in reverse order compared to compilation :-(

TODO :

  • check that it works for dev
  • check that it works for prod

serve font with CORS

right now, fonts aren't served with correct CORS headers and it seems to fail in iframe contexts...

add better logs

know what goes through a node and how much time it takes...

The big split

dag behaviours and code on one side and recipes and tasks on the other...

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.