0
我是一个新手,现在才刚刚起步。我很困惑给我的任务src和目的地。我正在尝试做的是创建一个像下面一样的内部层次结构的新minify目标文件夹。吞咽:uglify在不同的目的地文件夹内具有相同的层次
当前文件夹结构(正本文件):
app
-components
--post-creator
---post-creator.component.js
--post-rating
---post-rating.component.js
-routing_components
--app-routing
---app-routing.component.js
--user-routing
---user-routing.component.js
缩减大小的文件夹(其中js文件的精缩):
minify_destination
-components
--post-creator
---post-creator.component.js
--post-rating
---post-rating.component.js
-routing_components
--app-routing
---app-routing.component.js
--user-routing
---user-routing.component.js
Gulpfile.js
var gulp = require('gulp'),
uglify = require('gulp-uglify');
gulp.task('default', function() {
gulp.src('app/components/*/*/*.js')
.pipe(uglify())
.pipe(gulp.dest(components_min))
});