Gulp: Getting Started

妖精的绣舞 提交于 2020-01-11 00:58:05

https://github.com/gulpjs/gulp/blob/master/docs/getting-started.md

1. Install gulp globally:

$ npm install --global gulp

2. Install gulp in your project devDependencies:

$ cd C:\Work\MyProject
$ npm install --save-dev gulp

3. Install gulp-concat

$ npm install --save-dev gulp-concat

4. Create a gulpfile.js at the root of your project:

var gulp = require('gulp'),
    concat = require("gulp-concat");

gulp.task('packScripts', function() {
    gulp.src('Scripts/*.js')
        .pipe(concat('all.js'))
        .pipe(gulp.dest('Scripts'));
});

gulp.task('packStyles', function() {
    gulp.src('Content/*.css')
        .pipe(concat('all.css'))
        .pipe(gulp.dest('Content'));
});

gulp.task('default', ['packScripts', 'packStyles']);

5. Run gulp:

$ gulp

 

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!