We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
若干文件自定义合并
npm install --save-dev gulp-concat
[{ "src": [ "/lib/jquery.js", "/lib/template.js", "/lib/json2.js", "/lib/prototype.js" ], "dest": "/lib/lib_combo.js" }]
var gulp = require('gulp'); var uglify = require('gulp-uglify'); var concat = require('gulp-concat'); var paths = { scripts: { source : '../src/js/**/*.js', release: '../release/js' }, css : { source : '../src/css/**/*.css', release : '../release/css' }, html : { source : '../src/html/**/*.html', release : '../release/html' } }; process.on('uncaughtException', function(err) { console.log(err); }) /* * 文件压缩 */ gulp.task('move', function() { gulp.src(paths.scripts.source,"!" + paths.scripts.source + "/lib/*.js") .pipe(uglify()) .pipe(gulp.dest(paths.scripts.release)); }); //js合并任务(读取合并配置) gulp.task('merge', function() { var data = require('./merge.json'); data.forEach(function(o) { var arr = []; o.src.forEach(function(s) { arr.push(paths.scripts.source + "/" + s); }); o.src = arr; gulp.src(o.src).pipe(concat(o.dest)).pipe(gulp.dest(paths.scripts.release)); }); }); gulp.task('default', ["merge","move"], function() { });
同时看到我们把move任务中取出了common/lib文件夹的处理。
The text was updated successfully, but these errors were encountered:
No branches or pull requests
目标
步骤
同时看到我们把move任务中取出了common/lib文件夹的处理。
The text was updated successfully, but these errors were encountered: