Skip to content

Commit

Permalink
Add task production, transpile and minify js
Browse files Browse the repository at this point in the history
  • Loading branch information
Sky161 committed Sep 14, 2016
1 parent 7e29d06 commit 8317f7e
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
15 changes: 15 additions & 0 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ var autoprefixer = require('gulp-autoprefixer');
var browserSync = require('browser-sync').create();
var watch = require('gulp-watch');
var jade = require('gulp-jade');
var babel = require('gulp-babel');
var uglify = require('gulp-uglify');

var tplPath = './';

Expand Down Expand Up @@ -60,3 +62,16 @@ gulp.task('watch', ['jade', 'sass', 'scripts', 'server'], function () {
});

gulp.task('default', ['jade', 'sass', 'scripts']);

gulp.task('compress-js', function () {
setTimeout(function() {
gulp.src(tplPath + 'app/build.js')
.pipe(babel({
presets: ['es2015']
}))
.pipe(uglify())
.pipe(gulp.dest(tplPath + '/app/'));
}, 500);
});

gulp.task('prod', ['default', 'compress-js']);
11 changes: 10 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,28 @@
"main": "gulpfile.js",
"browserify": {
"transform": [
["jadeify", { "pretty": true, "compileDebug": true }]
[
"jadeify",
{
"pretty": true,
"compileDebug": true
}
]
]
},
"devDependencies": {
"babel-preset-es2015": "^6.14.0",
"bower": "^1.7.9",
"browser-sync": "^2.10.1",
"gulp": "^3.9.0",
"gulp-autoprefixer": "^3.1.0",
"gulp-babel": "^6.1.2",
"gulp-browserify": "^0.5.1",
"gulp-jade": "^1.1.0",
"gulp-plumber": "^1.0.1",
"gulp-rename": "^1.2.2",
"gulp-sass": "^2.3.2",
"gulp-uglify": "^2.0.0",
"gulp-watch": "^4.3.9",
"jadeify": "^4.6.0"
},
Expand Down

0 comments on commit 8317f7e

Please sign in to comment.