Skip to content
This repository was archived by the owner on Oct 1, 2023. It is now read-only.
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: urish/gulp-add-src
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 87bfcca62725a6bc19185f8e1bf60526277f546b
Choose a base ref
...
head repository: urish/gulp-add-src
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: c52a037c8cdfcaa16f2dab02134e816225490c59
Choose a head ref
  • 8 commits
  • 4 files changed
  • 5 contributors

Commits on Apr 10, 2015

  1. Copy the full SHA
    d68d978 View commit details
  2. Merge pull request #6 from SimenB/package.json-files

    Don't publish dotfiles or tests to npm registry
    urish committed Apr 10, 2015
    Copy the full SHA
    8898a42 View commit details

Commits on Jan 31, 2016

  1. More understandable readme.md

    When i read this file first time i could not find how i can add src to the begining of array.
    I think this text more understandable, then before.
    I bad speak english, so If my text have grammar errors, please correct it.
    IlyaMedzhidov committed Jan 31, 2016
    Copy the full SHA
    5837ec1 View commit details
  2. Update README.md

    IlyaMedzhidov committed Jan 31, 2016
    Copy the full SHA
    7899433 View commit details
  3. Merge pull request #12 from dslpp056193/patch-1

    Your readme, please)
    urish committed Jan 31, 2016
    Copy the full SHA
    ab2cabd View commit details

Commits on Mar 28, 2018

  1. make node 8 LTS compatible

    The old version of vinyl only works with node 6.x. to update to the next node LTS release an vinyl-fs is needed. I also updated the versio to have a node 6.x release
    konsultaner authored Mar 28, 2018
    Copy the full SHA
    1215372 View commit details
  2. Merge pull request #15 from konsultaner/master

    make node 8 LTS compatible
    urish authored Mar 28, 2018
    Copy the full SHA
    ae8496c View commit details
  3. chore: release 1.0.0

    urish committed Mar 28, 2018
    Copy the full SHA
    c52a037 View commit details
Showing with 29 additions and 4 deletions.
  1. +3 −0 CHANGELOG.md
  2. +20 −1 README.md
  3. +1 −1 index.js
  4. +5 −2 package.json
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Changelog

## 1.0.0 - 2018-03-28
- Make node 8 LTS compatible ([#15](https://github.com/urish/gulp-add-src/pull/15))

## 0.2.0 - 2014-11-08

- Add `append()` and `prepend()` methods for controlling added files position ([#4](https://github.com/urish/gulp-add-src/pull/4), contributed by [CWSpear](https://github.com/CWSpear))
21 changes: 20 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -33,7 +33,26 @@ gulp.task('build', function () {
});
```

The order of files when the streams are merged is not guaranteed. If you need to preserve order and specifically append/prepend files, you can use `addsrc.append` and `addsrc.prepend`, respectively, in place of just `addsrc` in the example above.
If you want add SRC to begining of the SRC array, you can use `addsrc.prepend`.
Or if you want to add SRC to end of the SRC array, you can use `addsrc.append`.
Respectively instead of addsrc.

Example use addsrc.append and addsrc.prepend:
```js
var gulp = require('gulp');
var addsrc = require('gulp-add-src');
var coffee = require('gulp-coffee');
var uglify = require('gulp-uglify');

gulp.task('build.angular', function () {
return gulp.src('files/coffee/*.coffee') // start with the .coffee files in the project
.pipe(coffee()) // compiles coffee script
.pipe(addsrc.prepend('files/js/constants.js')) // we use `addsrc.prepend` to add our .js files to begining of the SRC array
.pipe(addsrc.append('files/js/conflict.js')) // we use `addsrc.append` to add our .js files to end of the SRC array
.pipe(uglify()) // we minify everything
.pipe(gulp.dest('dist')); // and write to dist
});
```

As an example, this would be useful if you wanted to merge your `bower` scripts with your app scripts. You'd need your `bower` scripts to maintain their order (the `bower` scripts themselves) and make sure they come before your app scripts. In this case, you'd use `addsrc.prepend`.

2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* gulp-add-src / v0.1.1 / (c) 2014 Uri Shaked / MIT Licence */
/* gulp-add-src / v1.0.0 / (c) 2014 Uri Shaked / MIT Licence */

'use strict';
var through = require('through2');
7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
{
"name": "gulp-add-src",
"version": "0.2.0",
"version": "1.0.0",
"description": "Add more 'src' files at any point in the pipeline (gulp plugin)",
"main": "index.js",
"scripts": {
"test": "node_modules/.bin/mocha"
},
"files": [
"index.js"
],
"repository": {
"type": "git",
"url": "https://github.com/urish/gulp-add-src"
@@ -25,7 +28,7 @@
"event-stream": "~3.1.5",
"streamqueue": "^0.1.1",
"through2": "~0.4.1",
"vinyl-fs": "~0.3.11"
"vinyl-fs": "~3.0.2"
},
"devDependencies": {
"mocha": "^1.18.2",