Created
July 1, 2016 03:44
-
-
Save tedshd/7a13069a3f5a2cae36834a680172727b to your computer and use it in GitHub Desktop.
gulp setting package
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
| /** | |
| * | |
| * @authors Ted Shiu (ted@sitetag.us) | |
| * @date 2016-07-01 11:40:47 | |
| */ | |
| var gulp = require('gulp'), | |
| watch = require('gulp-watch'), | |
| cssmin = require('gulp-cssmin'), | |
| uglify = require('gulp-uglify'), | |
| concat = require('gulp-concat'); | |
| var css ='', | |
| device = '', | |
| js = ''; | |
| gulp.task('default', function (cb) { | |
| var options = {}; | |
| watch('./**/*.css', options, function (e) { | |
| // console.log('e:'+JSON.stringify(e)); | |
| console.log(new Date() + ' -- ' + e.history[0].replace(e.base, '')); | |
| // console.log('\n'); | |
| gulp.src('./dev/css/*.css') | |
| .pipe(concat('site.css' , {newLine: '\n'})) | |
| .pipe(cssmin()) | |
| .pipe(gulp.dest('./build/')); | |
| }); | |
| watch('./**/*.js', options, function (e) { | |
| // console.log('e:'+JSON.stringify(e)); | |
| console.log(new Date() + ' -- ' + e.history[0].replace(e.base, '')); | |
| // console.log('\n'); | |
| gulp.src('./dev/js/*.js') | |
| .pipe(concat('site.js' , {newLine: '\n'})) | |
| .pipe(uglify()) | |
| .pipe(gulp.dest('./build/js/')); | |
| }); | |
| }); |
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": "", | |
| "version": "", | |
| "devDependencies": { | |
| "gulp": "^3.9.0", | |
| "gulp-concat": "^2.6.0", | |
| "gulp-cssmin": "^0.1.7", | |
| "gulp-uglify": "^1.5.3", | |
| "gulp-watch": "^4.3.5" | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment