Content deleted Content added
Visaldatta (talk | contribs) |
Visaldatta (talk | contribs) No edit summary |
||
Line 74:
=== Image Task ===
For the following example, the '' gulp-imagemin plugin '' <ref>{{url|https://www.npmjs.com/package/gulp-imagemin/gulp-imagemin Plugin}}</ref> required. For this, by running the command <code> {{lang | npm install --save-dev-gulp imagemin} | s}} </code>
Subsequently, the module must be at the beginning of '' gulpfile.js 'defined' as: ''<syntaxhighlight lang= "javascript">
var imagemin = require ( 'gulp-imagemin');
</syntaxhighlight>
The subsequent image Task performs optimising images. <Code> gulp.src () </code> retrieves all the images with the extension .png, .gif or .jpg in the directory '' <nowiki/> 'images-orig/' <nowiki/> ''. <Code> .pipe (imagemin ()) </code> schedules the images found by the optimisation process through and with <code> .pipe (gulp.dest ()) </code> are the optimised images afterwards to
// Images task
gulp.task ( 'images', function () {
Line 91:
=== Scripts Task ===
In the following example, all JavaScript files from the directory '' <nowiki/> 'scripts/' <nowiki/> '' <code> .pipe (uglify ()) </code>
//Script task
gulp.task ( 'scripts', function () {
Line 101:
=== Watch Task ===
The Watch-task serves to react to changes
// Rerun the task When a file changes
gulp.task ( 'watch', function () {
|