下面是我的templates文件夹结构的一个示例
--myTemplate
--leadpages-template
--index.html
--myTemplate2
--leadpages-template
--index.html
->myTemplate3
--leadpages-template
--index.html我有一系列的子文件夹,每个子文件夹代表一个不同的模板。该子文件夹的必需子文件夹是另一个名为leadpages-template的文件夹,LeadPages™市场模板需要该文件夹。
我有一个全局的gulp任务,它监视所有的东西,然后运行各种任务,如zip文件创建,SASS编译,JS连接等。这些任务中的每一个最终都在被监视文件被更改的子文件夹内。
我遇到的问题是gulp connect任务:
var gulp = require('gulp'),
connect = require('gulp-connect');
gulp.task('connect', function() {
connect.server({
root: './',
livereload: true
});
});如果我提供我的根文件夹,我就能够访问:
http://localhost:8080/myTemplate/leadpages-template
http://localhost:8080/myTemplate2/leadpages-template
http://localhost:8080/myTemplate3/leadpages-template我想要做的是简单地访问:
http://localhost:8080/myTemplate
http://localhost:8080/myTemplate2
http://localhost:8080/myTemplate3在过去,我用多个根在模板级完成了这项工作,例如root: ['./','leadpages-template']。但是现在,我已经将连接作业上移到根templates文件夹,所以我不确定如何提供如下内容:root: ['./', './**/leadpages-template']
这可以做到吗?
发布于 2015-01-28 07:21:21
Gulp-connect-multi似乎具有该功能
https://stackoverflow.com/questions/28181777
复制相似问题