Skip to content
This repository was archived by the owner on Nov 4, 2021. It is now read-only.

Commit 054a409

Browse files
committed
feat(): add scripts-copy task
1 parent 5f29e03 commit 054a409

File tree

5 files changed

+54
-2
lines changed

5 files changed

+54
-2
lines changed

fonts-copy/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ var copyFonts = require('ionic-gulp-fonts-copy');
2020
gulp.task('fonts', copyFonts);
2121
2222
gulp.task('fonts', function(){
23-
return copyFonts({ dest: 'www/my-custom-build-dir'});
23+
return copyFonts({ dest: 'www/my-custom-build-dir' });
2424
});
2525
```
2626

html-copy/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ var copyHTML = require('ionic-gulp-html-copy');
2020
gulp.task('html', copyHTML);
2121
2222
gulp.task('html', function(){
23-
return copyHTML({ dest: 'www/my-custom-build-dir'});
23+
return copyHTML({ dest: 'www/my-custom-build-dir' });
2424
});
2525
```
2626

scripts-copy/README.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Scripts Copy Task
2+
Copy default 3rd party scripts to build directory.
3+
4+
## API
5+
6+
### copyScripts([options])
7+
8+
Returns a [stream](http://nodejs.org/api/stream.html) of [Vinyl files](https://github.com/wearefractal/vinyl-fs)
9+
that can be [piped](http://nodejs.org/api/stream.html#stream_readable_pipe_destination_options).
10+
11+
#### Available options:
12+
- **src** (String|Array) Glob or array of globs ([What's a glob?](https://github.com/isaacs/node-glob#glob-primer)) matching 3rd party script files. Default: `'node_modules/angular2/bundles/angular2-polyfills.js'`.
13+
- **dest** (String) Output path for the HTML files. Default: `'www/build/js'`.
14+
15+
## Example
16+
17+
```
18+
var copyScripts = require('ionic-gulp-scripts-copy');
19+
20+
gulp.task('scripts', copyScripts);
21+
22+
gulp.task('scripts', function(){
23+
return copyScripts({ dest: 'www/my-custom-build-dir' });
24+
});
25+
```
26+
27+
28+
29+
30+

scripts-copy/index.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
var gulp = require('gulp');
2+
3+
module.exports = function(options) {
4+
options.src = options.src || 'node_modules/angular2/bundles/angular2-polyfills.js';
5+
options.dest = options.dest || 'www/build/js';
6+
7+
return gulp.src(options.src)
8+
.pipe(gulp.dest(options.dest));
9+
}

scripts-copy/package.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"name": "ionic-gulp-scripts-copy",
3+
"description": "Gulp task for Ionic projects to copy default 3rd party scripts to a build directory",
4+
"license": "MIT",
5+
"repository": {
6+
"type": "git",
7+
"url": "https://github.com/driftyco/ionic-gulp-tasks.git"
8+
},
9+
"version": "1.0.0",
10+
"dependencies": {
11+
"gulp": "^3.9.1"
12+
}
13+
}

0 commit comments

Comments
 (0)