我創建2任務,「compileApp」和「compileAppDeploy」排除所有文件。基本上它們只是相似compileAppDeploy minify要部署的代碼。一飲而盡SRC不是從一個文件夾
獨立任務都運行良好,如果compileAppDeploy運轉,儘管第一再從DIST文件夾
未成功我試過幾個路徑的組合compileApp CONCAT精縮代碼。雖然如果我設置下面的路徑,然後javaScriptMinified.js將被刪除,但htmlAngularMinified.js將concated。
'!./app/dist/*.js
目錄結構
+root
+app
+dist -> Exclude
-javaScriptMinified.js -> after run compileAppDeploy task
-htmlAngularMinified.js -> after run compileAppDeploy task
+filters -> Include
+l10n -> Exclude
+components -> Include
-app.js -> Include
+css
-gulpfile.js
-index.html
-package.json
compileApp
gulp.task('compileApp', function() {
return gulp.src(['./app/app.js','./app/**/*.js','!./app/dist/'])
.pipe(plumber({errorHandler : onError}))
.pipe(concat('LoginPortal.min.js'))
.pipe(gulp.dest('./app/'));
});
compileAppDeploy
gulp.task('compileAppDeploy', function(version) {
return gulp.src(['./app/app.js','./app/**/*.js','!./app/dist/'])
.pipe(plumber({errorHandler : onError}))
.pipe(stripDebug())
.pipe(uglify({
warnings : false
}))
.pipe(replace('app/l10n' ,'' + version + '/l10n'))
.pipe(concat('LoginPortal' + version + '.min.js'))
.pipe(gulp.dest('./app/dist/' + version + '/'));
});