• Search form is empty!

  • 006 Gulp - copy & src & dest

    http://robertdunaway.github.io

    Gulp code kata list

    All code katas lists

    Smiley face

    006 Gulp - copy & src & dest

    Duration

    5 minutes

    Brief

    In this kata we will copy our source files to a destination.

    For more information

    BING/GOOGLE: “Gulp src dest”

    Book:
    Gulp - Quick guide to getting up and running today

    Smiley face

    Instructions

    Get tutorial folder or the entire katas-Gulp repo.
    Open the [before/*.sln] file and execute the kata.
    Feel free to execute this kata multiple times because repetition creates motor memory.

    Github

    Kata

    Create a task to copy all files from the “src” folder to the destination folder, “wwwroot”.


    We copy our files to wwwroot because this is the default folder used by Asp.Net. Once the files are copied other tasks can operate against the files.


    Keeping the source code and generated files apart make source control management cleaner and more obvious.


    All that is required to copy files is gulp. No plugins need installed.


    
    var gulp = require('gulp');
    
    gulp.task('copy-to-wwwroot', function () {
        return gulp.src(['src/**/*'])
        .pipe(gulp.dest('wwwroot'));
    });
    
    


    The two commands, you’ll find in most files are:

    
        gulp.src()
    
        gulp.dest()
    
    


    The result of executing the copy-to-wwwroot task is


    Next

    Take a few minutes and imagine more examples.


    Smiley face

    0 comments:

    Post a Comment