Skip to content

Commit

Permalink
updated gulpfile
Browse files Browse the repository at this point in the history
  • Loading branch information
mjhea0 committed Oct 11, 2015
1 parent 38daeae commit 77da364
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 22 deletions.
40 changes: 28 additions & 12 deletions gulpfile.js
Expand Up @@ -9,6 +9,7 @@ var minifyCSS = require('gulp-minify-css');
var clean = require('gulp-clean');
var browserify = require('gulp-browserify');
var concat = require('gulp-concat');
var runSequence = require('run-sequence');

// tasks
gulp.task('lint', function() {
Expand All @@ -27,15 +28,15 @@ gulp.task('minify-css', function() {
var opts = {comments:true,spare:true};
gulp.src(['./app/**/*.css', '!./app/bower_components/**'])
.pipe(minifyCSS(opts))
.pipe(gulp.dest('./dist/'))
.pipe(gulp.dest('./dist/'));
});
gulp.task('minify-js', function() {
gulp.src(['./app/**/*.js', '!./app/bower_components/**'])
.pipe(uglify({
// inSourceMap:
// outSourceMap: "app.js.map"
}))
.pipe(gulp.dest('./dist/'))
.pipe(gulp.dest('./dist/'));
});
gulp.task('copy-bower-components', function () {
gulp.src('./app/bower_components/**')
Expand Down Expand Up @@ -64,7 +65,7 @@ gulp.task('browserify', function() {
debug: true
}))
.pipe(concat('bundled.js'))
.pipe(gulp.dest('./app/js'))
.pipe(gulp.dest('./app/js'));
});
gulp.task('browserifyDist', function() {
gulp.src(['app/js/main.js'])
Expand All @@ -73,15 +74,30 @@ gulp.task('browserifyDist', function() {
debug: true
}))
.pipe(concat('bundled.js'))
.pipe(gulp.dest('./dist/js'))
.pipe(gulp.dest('./dist/js'));
});


// default task
gulp.task('default',
['lint', 'browserify', 'connect']
);
// build task
gulp.task('build',
['lint', 'minify-css', 'browserifyDist', 'copy-html-files', 'copy-bower-components', 'connectDist']
);
// // *** default task *** //
// gulp.task('default',
// ['lint', 'browserify', 'connect']
// );
// // *** build task *** //
// gulp.task('build',
// ['lint', 'minify-css', 'browserifyDist', 'copy-html-files', 'copy-bower-components', 'connectDist']
// );

// *** default task *** //
gulp.task('default', function() {
runSequence(
['clean'],
['lint', 'browserify', 'connect']
);
});
// *** build task *** //
gulp.task('build', function() {
runSequence(
['clean'],
['lint', 'minify-css', 'browserifyDist', 'copy-html-files', 'copy-bower-components', 'connectDist']
);
});
21 changes: 11 additions & 10 deletions package.json
Expand Up @@ -9,18 +9,19 @@
"author": "",
"license": "ISC",
"dependencies": {
"gulp-uglify": "^0.3.1",
"gulp-minify-css": "^0.3.7",
"angular": "^1.2.21",
"angular-animate": "^1.2.16",
"angular-route": "^1.2.17-build.163.1",
"bower": "^1.3.9",
"browserify": "^5.10.0",
"gulp": "^3.8.7",
"gulp-browserify": "^0.5.0",
"gulp-clean": "^0.3.1",
"gulp-concat": "^2.3.4",
"gulp-connect": "^2.0.6",
"gulp-jshint": "^1.8.4",
"gulp": "^3.8.7",
"bower": "^1.3.9",
"gulp-concat": "^2.3.4",
"gulp-browserify": "^0.5.0",
"browserify": "^5.10.0",
"angular-animate": "^1.2.16",
"angular": "^1.2.21",
"angular-route": "^1.2.17-build.163.1"
"gulp-minify-css": "^0.3.7",
"gulp-uglify": "^0.3.1",
"run-sequence": "^1.1.4"
}
}

0 comments on commit 77da364

Please sign in to comment.