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

Commit ab2cabd

Browse files
committedJan 31, 2016
Merge pull request #12 from dslpp056193/patch-1
Your readme, please)
2 parents 8898a42 + 7899433 commit ab2cabd

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed
 

‎README.md

+20-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,26 @@ gulp.task('build', function () {
3333
});
3434
```
3535

36-
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.
36+
If you want add SRC to begining of the SRC array, you can use `addsrc.prepend`.
37+
Or if you want to add SRC to end of the SRC array, you can use `addsrc.append`.
38+
Respectively instead of addsrc.
39+
40+
Example use addsrc.append and addsrc.prepend:
41+
```js
42+
var gulp = require('gulp');
43+
var addsrc = require('gulp-add-src');
44+
var coffee = require('gulp-coffee');
45+
var uglify = require('gulp-uglify');
46+
47+
gulp.task('build.angular', function () {
48+
return gulp.src('files/coffee/*.coffee') // start with the .coffee files in the project
49+
.pipe(coffee()) // compiles coffee script
50+
.pipe(addsrc.prepend('files/js/constants.js')) // we use `addsrc.prepend` to add our .js files to begining of the SRC array
51+
.pipe(addsrc.append('files/js/conflict.js')) // we use `addsrc.append` to add our .js files to end of the SRC array
52+
.pipe(uglify()) // we minify everything
53+
.pipe(gulp.dest('dist')); // and write to dist
54+
});
55+
```
3756

3857
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`.
3958

0 commit comments

Comments
 (0)
This repository has been archived.