@@ -215,4 +215,42 @@ gulp.task('default', ['clean'], function() {
215215 gutil . log ( '| Gulp is now building... |' ) ;
216216 gutil . log ( '===========================' ) ;
217217 gulp . start ( 'html' , 'sass' , 'scripts' ) ;
218- } ) ;
218+ } ) ;
219+
220+
221+ /****************************************************/
222+ /* CLOUD PRODUCTION ENVIRONMENT TASKS */
223+ /****************************************************/
224+
225+ // Compile Sass & Minify CSS for cloud production environment
226+ gulp . task ( 'production:styles' , function ( ) {
227+ gutil . log ( 'Gulp is compiling the SASS and concatenating and minifying the CSS' ) ;
228+ return gulp . src ( pathSass + '*.scss' )
229+ . pipe ( sass ( ) )
230+ . pipe ( concat ( distCssFile ) )
231+ . pipe ( cssmin ( ) )
232+ . pipe ( header ( opts . banner , pkg ) )
233+ . pipe ( gulp . dest ( distCssPath ) ) ;
234+ } ) ;
235+
236+ // Concatenate & Minify JS for cloud production environment
237+ gulp . task ( 'production:scripts' , function ( ) {
238+ gutil . log ( 'Gulp is concatenating and minifying the JavaScripts' ) ;
239+ return gulp . src ( [
240+ jsLibs + '*.js' ,
241+ pathJs + '*.js' ,
242+ pathJs + '**/*.js'
243+ ] )
244+ . pipe ( concat ( distJsFile ) )
245+ . pipe ( uglify ( { mangle : false } ) )
246+ . pipe ( header ( opts . banner , pkg ) )
247+ . pipe ( gulp . dest ( distJsPath ) ) ;
248+ } ) ;
249+
250+ // Default cloud production task
251+ gulp . task ( 'production:default' , [ 'clean' ] , function ( ) {
252+ gutil . log ( '===========================' ) ;
253+ gutil . log ( '| Gulp is now building... |' ) ;
254+ gutil . log ( '===========================' ) ;
255+ gulp . start ( 'production:styles' , 'production:scripts' ) ;
256+ } ) ;
0 commit comments