Skip to content

Commit be15965

Browse files
authored
Merge pull request #2 from mraible/gulp
Add Gulp and Browsersync
2 parents 016fea7 + 88de294 commit be15965

File tree

5 files changed

+54
-55
lines changed

5 files changed

+54
-55
lines changed

Gruntfile.js

Lines changed: 0 additions & 44 deletions
This file was deleted.
File renamed without changes.

app/index.html

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
<!DOCTYPE html>
2-
<!--[if lt IE 7]> <html lang="en" ng-app="myApp" class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
3-
<!--[if IE 7]> <html lang="en" ng-app="myApp" class="no-js lt-ie9 lt-ie8"> <![endif]-->
4-
<!--[if IE 8]> <html lang="en" ng-app="myApp" class="no-js lt-ie9"> <![endif]-->
5-
<!--[if gt IE 8]><!--> <html lang="en" ng-app="myApp" class="no-js"> <!--<![endif]-->
1+
<!doctype html>
2+
<html lang="en" ng-app="myApp">
63
<head>
74
<meta charset="utf-8">
85
<meta http-equiv="X-UA-Compatible" content="IE=edge">
96
<title>My AngularJS App</title>
107
<meta name="description" content="">
118
<meta name="viewport" content="width=device-width, initial-scale=1">
9+
<!-- build:css css/seed.min.css -->
1210
<link rel="stylesheet" href="bower_components/html5-boilerplate/dist/css/normalize.css">
1311
<link rel="stylesheet" href="bower_components/html5-boilerplate/dist/css/main.css">
14-
<link rel="stylesheet" href="app.css">
12+
<link rel="stylesheet" href="css/app.css">
13+
<link rel="stylesheet" href="css/app2.css">
14+
<!-- endbuild -->
1515
<script src="bower_components/html5-boilerplate/dist/js/vendor/modernizr-2.8.3.min.js"></script>
1616
</head>
1717
<body>
@@ -28,9 +28,7 @@
2828

2929
<div>Angular seed app: v<span app-version></span></div>
3030

31-
<!-- In production use:
32-
<script src="//ajax.googleapis.com/ajax/libs/angularjs/x.x.x/angular.min.js"></script>
33-
-->
31+
<!-- build:js js/seed.min.js -->
3432
<script src="bower_components/angular/angular.js"></script>
3533
<script src="bower_components/angular-ui-router/release/angular-ui-router.js"></script>
3634
<script src="app.js"></script>
@@ -39,5 +37,6 @@
3937
<script src="components/version/version.js"></script>
4038
<script src="components/version/version-directive.js"></script>
4139
<script src="components/version/interpolate-filter.js"></script>
40+
<!-- endbuild -->
4241
</body>
4342
</html>

gulpfile.js

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
var gulp = require('gulp');
2+
var browserSync = require('browser-sync').create();
3+
$ = require('gulp-load-plugins')();
4+
5+
gulp.task('clean', function () {
6+
return gulp.src('dist/')
7+
.pipe($.clean());
8+
});
9+
10+
gulp.task('copy', ['clean'], function () {
11+
gulp.src(['**', '!index*.html*', '!js/**', '!lib/**', '!**/*.css'], {cwd: 'app/'})
12+
.pipe(gulp.dest('dist/.'));
13+
});
14+
15+
gulp.task('dist', ['copy'], function () {
16+
return gulp.src('app/index.html')
17+
.pipe($.usemin({
18+
css: [$.cleanCss(), $.rev()],
19+
js: [$.uglify(), $.rev()]
20+
}))
21+
.pipe(gulp.dest('dist/'));
22+
});
23+
24+
gulp.task('serve', function() {
25+
26+
browserSync.init({
27+
server: './app'
28+
});
29+
30+
gulp.watch(['app/**/*.js', 'app/**/*.css', 'app/**/*.html'])
31+
.on('change', browserSync.reload);
32+
});
33+
34+
// Tell Gulp what to do when we type "gulp" into the terminal
35+
gulp.task('default', ['serve']);

package.json

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,21 @@
11
{
22
"name": "angular-seed",
33
"private": true,
4-
"version": "0.0.0",
4+
"version": "1.1.0",
55
"description": "A starter project for AngularJS",
6-
"repository": "https://github.com/angular/angular-seed",
6+
"repository": "https://github.com/mraible/angular-seed",
77
"license": "MIT",
88
"devDependencies": {
99
"bower": "^1.7.7",
10+
"browser-sync": "~2.15.0",
11+
"gulp": "~3.9.1",
12+
"gulp-clean": "~0.3.2",
13+
"gulp-concat": "~2.6.0",
14+
"gulp-load-plugins": "~1.3.0",
15+
"gulp-clean-css": "~2.0.13",
16+
"gulp-rev": "~7.1.2",
17+
"gulp-uglify": "~2.0.0",
18+
"gulp-usemin": "~0.3.24",
1019
"http-server": "^0.9.0",
1120
"jasmine-core": "^2.4.1",
1221
"karma": "^0.13.22",

0 commit comments

Comments
 (0)