Question
How to concat, uglify and rename all javascript files using gulp?

Answers

var gulp = require('gulp'); 
var concat = require('gulp-concat');
var uglify = require('gulp-uglify');
var rename = require('gulp-rename');
 
// Concatenate & Minify JS
gulp.task('scripts', function() {
    return gulp.src('js/*.js')
        .pipe(concat('all.js'))
        .pipe(gulp.dest('dist'))
        .pipe(rename('all.min.js'))
        .pipe(uglify())
        .pipe(gulp.dest('dist'));
});
 
// Watch Files For Changes
gulp.task('watch', function() {
    gulp.watch('js/*.js', ['lint', 'scripts']);
});
 
// Default Task
gulp.task('default', ['scripts', 'watch']);   Your Comment




More Software Questions..
What is the inputsplit in map reduce software?

What is software configuration management?

What Is Java Api For Xml-based Rpc (jax-rpc)?

How can you implement fine-grained auditing?

What is IBM’s simple explanation for Big Data’s four critical features?

What is static synchronized method in JDBC API? Give an example?

What does the NULLIF function do?

What happens if a start method is not invoked and the run method is directly invoked?

Should we override finalize method

what is the difference between mysql_fetch_array and mysql_fetch_object?

How will XML affect my document links?

Why to use Style Sheets?

What are Filters in MVC?

Can you explain Application layer in OSI model?

How to define new testplan attributes?

What are the minimum system requirements to run Photoshop? Is it possible to run Photoshop over linux?

Which oracle package is used to manage the oracle lock management services?

What is Latch Up? Explain Latch Up with cross section of a CMOS Inverter. How do you avoid Latch Up?

What is marker interface?

What types of partitioning are there for BW?



Search
Can you Answer!!
  • Q What are the family and order of Wrasse ?
  • Q How can i configure workflow to track record for every change of material in material master?
  • Q N = ((8.42)**2)*(95. ....)/((0.982)*(64.....)**2) If N contains the first three digits as 988,Which of the following is the nearest answer 9.88, 98.8, 988, none
  • Q A port has four berths W,V,X,Y. Of these two are general cargo berth, one is a fertiliser berth and one is for liquid cargo, When vessel A arrived it was berthed at berth V but vessel B which along with A had to wait prior to berthing as vessel C was working in berth Y and vessel D was working in berth W .Vessel E came to unload fertiliser and did not have to wait. All are specilised berths i.e. general cargo vessel has to work only in a general cargo berth. So is true for fertiliser vessel and liquid cargo vessel. Whcih of the following allotments is possible
  • Q Why is a stop statement needed for the point= option on a set statement?
  • Q Periyar Tiger Reserve is in which state?
  • Q What is the difference between user and versatile?
  • Q What commands are included in grouping results category?
  • Q What is the reason behind performing automated load testing?
  • Q The process of transferring files from Internet to your computer is called:
  • Q My application has only a service, and my service performs heavy lift functionality to connect to internet and fetch data, now should I create a thread or not? If so why?