2016-11-10 1 views
1

내 gulpfile에서 deploy 폴더에 접근하고 싶습니다. gulpfile을 소스 폴더에 위치시켜 깔끔하게 유지합니다. 나의 현재 폴더 구조 :루트에 대한 Gulpfile 상대 경로

var path = { 
    js: { 
     src: [ 
      './source/_base/**/js/*.js', 
      './source/_structure/**/js/*.js' 
     ], 
     deploy: [ 
      '../deploy/js/' 
     ] 
    }, 
// more below this line 

꿀꺽 작업 :

gulp.task('process-js', function(){ 
    gulp.src(path.js.src) 
    .pipe(plumber()) 
    .pipe(jshint()) 
    .pipe(jshint.reporter(stylish)) 
    .pipe(concat('main.min.js')) 
    .pipe(uglify()) 
    .pipe(plumber.stop()) 
    .pipe(gulp.dest(path.js.deploy)); 
}); 

deploy 
├── js 
├── css 
├── img 
└── index.php 
source 
├── node_modules 
├── base 
├── structure 
└── gulpfile.js 

구조는 전체 트리 gulpfile.js의

부분의 일부입니다

내 꿀꺽 꿀꺽 마시는 작업을 실행할 때 (이 배포판을 사용하는 경우) ATH) 나는 오류가 발생 :
:Error: Invalid output folder at Gulp.dest

질문 : 루트 폴더의 상위에있는 파일을 배치 할 gulpfile 상대 경로를 사용할 수있는 방법
.

+0

'gulp.dest()'에 전달할 내용을 모르지만'../deploy/js/ ''이 아닙니다. –

+0

해당 코드 조각을 추가하지 못했습니다. 질문을 수정했습니다. –

+1

글쎄요, 문제가 있습니다. 'path.js.deploy'는 배열이 아니라 문자열입니다. –

답변

0

해결책을 찾았습니다. 물론 배열을 대상으로 파싱 할 수 없습니다.