Giter Site home page Giter Site logo

gulp-remote-src's Introduction

gulp-remote-src

Build Status

Remote gulp.src.

Installation

Install package with NPM and add it to your development dependencies:

npm install --save-dev gulp-remote-src

Usage

var gulp = require('gulp');
var uglify = require('gulp-uglify');
var remoteSrc = require('gulp-remote-src');

gulp.task('remote', function() {
    
remoteSrc(['app.js', 'jquery.js'], {
        base: 'http://myapps.com/assets/'
    })
    .pipe(uglify())
    .pipe(gulp.dest('./dist/'));
})

Options

  • base

    Url base.

    If you want to use absolute urls instead of relative ones, set this to null. When not configured, / is assumed.

  • buffer (default is true)

    Pipe out files as buffer or as stream. Note that some plugins do not support streaming.

  • requestOptions

    Options to be passed to request

gulp-remote-src's People

Contributors

ddliu avatar ghusse avatar jimic avatar magomogo avatar mamodom avatar matthiaskunnen avatar philkunz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

gulp-remote-src's Issues

Update to latest version of `request` to avoid security vulnerability

I guess you've probably had an alert about this, but the version of request this package references has a dependency on a vulnerable version of hoek (via hawk). vscode has a dependency on this gulp-remote-src so all VS Code extensions have received alerts from GitHub about this.

Info is here: https://nvd.nist.gov/vuln/detail/CVE-2018-3728

I think updating to the latest version of request should fix it, though I don't know whether it's a straight forward upgrade.

Error: ETIMEOUT

Hi,
Recently I've start working with gulp-remote-src, but my internet connection isn't a high speed connection. So, usually my gulp task fails by this error:

Error: ETIMEOUT

How can I increase connection timeout for this script?

timeout

Feature Request: Add support for caching

Some remote contents is quite large and they won't change at all and it would be nice if developers can pass an option to indicate gulp-remote-src to cache them in order to increase build speed. Thanks!

Check status code logic is a bit severe

Hi, I'm using gulp-remote-src to trigger jenkins tasks via http request.
When everything is ok, Jenkins responds with a 201 response but i get a fail message about status code "failed with status code:201".

Why are you checking exactly if it's 200? Wouldn't it be better if it checks only if statusCode starts with "2"?

Multiple remote sources? Absolute path not working, too

The example works fine. However, it says I can change base to null, then use direct paths in the array.

However, doing so results in an uncaught err:

events.js:163
      throw er; // Unhandled 'error' event
      ^
Error: Line 2562: Unexpected string
    at constructError (/var/www/throneoflies.com/node_modules/esprima/esprima.js:2407:21)

How can I use absolute paths? I tried this:

    remoteSrc(['https://checkout.stripe.com/checkout.js'], {
        base: null // absolute paths
    })

Or if I use the old way, how can I do multiple? sources? Say, 1 stripe, 1 google api from different 'bases'?

Support option "jar"

Is that possible to support the option "jar" of request module? It is used to support cookie storage.

Absolute path

I am trying to load remote files from multiple cdns.
Is it possible to give absolute path and ommit base parameter? Could we make this a feature if not?

'throw new Error ('base must be set to non-empty string, or null/undefined.');

Summary: Version 0.4.2 should be considered a breaking change; update package.json to "version": "1.0.0",. (That's my conclusion. Forgive me for being a newbie.)

Problem: Receiving 'throw new Error ('base must be set to non-empty string, or null/undefined.');

The code where the error is occurring: return remoteSrc(devFilesArr, { base: '' })

I believe the problem stems from breaking changes—going from version 0.5.3 to "vinyl": "~2.0.1".

"devDependencies": {
    "babel-preset-es2015": "^6.18.0",
    "browser-sync": "^2.18.5",
    "gulp": "^3.9.0",
    "gulp-add-src": "^0.2.0",
    "gulp-autoprefixer": "^3.1.0",
    "gulp-babel": "^6.1.2",
    "gulp-cheerio": "^0.6.2",
    "gulp-clean": "^0.3.2",
    "gulp-clean-css": "^2.0.13",
    "gulp-concat": "^2.6.1",
    "gulp-eslint": "^3.0.1",
    "gulp-file-include": "^0.13.7",
    "gulp-filter": "^4.0.0",
    "gulp-header": "^1.8.8",
    "gulp-html-replace": "^1.6.2",
    "gulp-htmlhint-networkaaron": "^0.3.2",
    "gulp-if": "^2.0.2",
    "gulp-ignore": "^2.0.2",
    "gulp-include": "^2.3.1",
    "gulp-inline-source": "^3.0.0",
    "gulp-newer": "^1.1.0",
    "gulp-notify": "^2.2.0",
    "gulp-order": "^1.1.1",
    "gulp-plumber": "^1.1.0",
    "gulp-remote-src": "^0.4.1",
    "gulp-rename": "^1.2.2",
    "gulp-replace": "^0.5.4",
    "gulp-sass": "^2.3.2",
    "gulp-sourcemaps": "^1.9.1",
    "gulp-stylelint": "^3.7.0",
    "gulp-uglify": "^2.0.0",
    "gulp-uncss": "^1.0.6",
    "gulp-wrapper": "^1.0.0",
    "html-validator": "^2.2.0",
    "inquirer": "^1.2.3",
    "jasmine": "^2.5.3",
    "minimist": "^1.2.0",
    "mkdirp": "^0.5.1",
    "request": "^2.67.0",
    "require-dir": "^0.3.0",
    "run-sequence": "^1.2.2",
    "through2": "^2.0.3",
    "yargs": "^6.5.0"
  }

Let me know if you need anything else.

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.