Last active
August 29, 2015 14:14
-
-
Save subtubes-io/63cf6fc1baeb196ba184 to your computer and use it in GitHub Desktop.
Gulp task to inject modular angularjs and bower dependencies
This file contains 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 wiredep = require('wiredep').stream; | |
gulp.task('default', function () { | |
var target = gulp.src('./app/index.html'); | |
var sources = gulp.src([ | |
'./app/scripts/**/*.module.js', | |
'./app/scripts/**/*.js', | |
'./app/scripts/app.js' | |
], {read: false}); | |
return target.pipe(inject(sources, {relative: true})) | |
.pipe(gulp.dest('./app')); | |
}); | |
gulp.task('bower', function () { | |
gulp.src('./app/index.html') | |
.pipe(wiredep({})) | |
.pipe(gulp.dest('./app')); | |
}); |
This file contains 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
<!DOCTYPE html> | |
<html data-ng-app="app"> | |
<head> | |
<title>My index</title> | |
<!-- inject:css --> | |
<!-- endinject --> | |
<!-- bower:css --> | |
<!-- endbower --> | |
</head> | |
<body> | |
<div humble></div> | |
<!-- bower:js --> | |
<script src="lib/angularjs/angular.js"></script> | |
<!-- endbower --> | |
<!-- inject:js --> | |
<script src="scripts/_common/common.module.js"></script> | |
<script src="scripts/login/login.module.js"></script> | |
<script src="scripts/app.js"></script> | |
<script src="scripts/login/directives/humble.js"></script> | |
<!-- endinject --> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment