정말 빠르게 보이는 Gulpjs를 사용해보고 싶습니다. Gulpjs의 다음 (일부) Gruntjs 구성을 번역하는 방법을 이해할 수 없습니다. 하나의 Gulpjs 작업에 이미 축소 된 파일을 추가하는 방법은 무엇입니까?
기본적 목적은 추하게 프로젝트 파일 플러스 일부 외부 종속성 (아직 축소 된) 하고 이미 축소 된 소스에 축약 과정을 방지하기 위해, 이미 축소 된 일부 종속성을 앞에 추가.uglify: {
dist: {
src: [
'<%= deps %>/bootstrap-daterangepicker/daterangepicker.js',
'<%= deps %>/smalot-bootstrap-datetimepicker/js/locales/*.js',
'src/js/**/*.js',
],
dest: '<%= clean.dist %>/js/<%= pkg.name %>.min.js'
}
},
concat: {
dist: {
src: [
'<%= deps %>/jquery/dist/jquery.min.js',
'<%= deps %>/bootstrap/dist/js/bootstrap.min.js',
'<%= deps %>/momentjs/min/moment-with-langs.min.js',
'<%= uglify.dist.dest %>'
],
dest: '<%= uglify.dist.dest %>'
}
},
어떻게 Gulpjs에서 동일한 작업을 수행 할 수 있습니까? 이것은 가능한가?
처럼는 지금 내 작업 (작동하지 않는, 결과는 jquery.min.js
단지 내용입니다) 모양 : 당신은 당신이 원하는 경우 "추하게"작업에서 스트림을 반환 (또는 another method을 사용) 할 필요가
gulp.task('uglify', function() {
gulp.src([
'./bower_components/bootstrap-daterangepicker/daterangepicker.js',
'./bower_components/smalot-bootstrap-datetimepicker/js/locales/*.js',
'./src/js/**/*.js'
])
.pipe(uglify())
.pipe(concat('admin-template.js'))
.pipe(gulp.dest('./dist/js'));
});
// Doesn't work
gulp.task('concat', ['uglify'], function() {
gulp.src([
'bower_components/jquery/dist/jquery.min.js',
'./dist/js/admin-template.js' // output of uglify task
])
.pipe(concat('admin-template.js'))
.pipe(gulp.dest('./dist/js/'));
});
감사합니다. 나는 스트림 대기열에 갈 것이라고 생각한다. – gremo