Created
April 22, 2015 00:39
-
-
Save pedroxs/aa2d60248819333a79a5 to your computer and use it in GitHub Desktop.
Frontend dependency management with auto import
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "name": "myApp", | |
| "private": "true", | |
| "devDependencies": { | |
| "ionic": "driftyco/ionic-bower#1.0.0-rc.2" | |
| }, | |
| "dependencies": { | |
| "ngCordova": "~0.1.14-alpha", | |
| "restangular": "~1.5.1" | |
| }, | |
| "overrides": { | |
| "angular": { | |
| "ignore": true | |
| } | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var gulp = require('gulp'); | |
| var inject = require('gulp-inject'); | |
| var bowerFiles = require('main-bower-files'); | |
| gulp.task('watch', function() { | |
| gulp.watch(paths.sources, ['inject']); | |
| }); | |
| gulp.task('inject', function () { | |
| var target = gulp.src('./www/index.html'); | |
| // It's not necessary to read the files (will speed up things), we're only after their paths: | |
| var vendor = gulp.src(bowerFiles(), {read: false, base: './www/lib'}); | |
| var sources = gulp.src(['./www/js/**/*.js', './www/css/**/*.css'], {read: false}); | |
| return target | |
| .pipe(inject(vendor, {name: 'bower', relative: true})) | |
| .pipe(inject(sources, {relative: true})) | |
| .pipe(gulp.dest('./www')); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment