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

Commit 5837ec1

Browse files
author
IlyaMedzhidov
committedJan 31, 2016
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.
1 parent 8898a42 commit 5837ec1

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