简体   繁体   中英

Gulp and absolute path

I am new in Gulp. I was wondering if I could have an absolute path for source like the code below:

var gulp = require('gulp');
var concat = require('gulp-concat');
var minify = require('gulp-minify-css');

gulp.task('hello', function() {
    return gulp.src(['C:\a\b\c\css\fonts.css',
    'C:\a\b\c\css\common.css',
    'C:\a\b\c\css\generic.css'])
    .pipe(concat('stylestest.css'))
    .pipe(minify())
    .pipe(gulp.dest('web'));
});

If not, is it possible to put gulp project and web application next to each other, instead of putting web application inside the gulp project directory. Actually, I don't want to change current structure of my project but I see people copy app inside gulp project folder.

By giving C:\\a\\b\\c\\css\\fonts.css' absolute path won't help you in integration, test and live branch.

I would recommend you to put gulp file parallel to the project folder and that is what gulp is also recommending.

Have a look below github link for reference :

https://github.com/varit05/gulp-build

I hope it helps you!

Cheers!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM