简体   繁体   English

吞咽和绝对的道路

[英]Gulp and absolute path

I am new in Gulp. 我是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. 如果没有,是否可以将gulp项目和Web应用程序放在一起,而不是将web应用程序放在gulp项目目录中。 Actually, I don't want to change current structure of my project but I see people copy app inside gulp project folder. 实际上,我不想改变我的项目的当前结构,但我看到人们在gulp项目文件夹中复制app。

By giving C:\\a\\b\\c\\css\\fonts.css' absolute path won't help you in integration, test and live branch. 通过提供C:\\a\\b\\c\\css\\fonts.css'绝对路径将无法帮助您进行集成,测试和实时分支。

I would recommend you to put gulp file parallel to the project folder and that is what gulp is also recommending. 我建议你将gulp文件与项目文件夹并行放置,这也是gulp推荐的内容。

Have a look below github link for reference : 看看下面的github链接以供参考:

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

I hope it helps you! 我希望它对你有所帮助!

Cheers! 干杯!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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