gulp-file-include2 [템플릿] gulp-file-include 사용법 1. @@include('템플릿 파일 위치') @@include('템플릿 파일 위치') @@include('파일위치', { 변수명 : 변수값 }) 2. @@var : 변수값 삽입용 @@변수명 3. @@if : 오직 if만 존재 @@if (변수 === 변수값){ 결과물 } 4. @@for @@include('템플릿 파일 위치', { 배열이름 : [아이템1, 아이템2, 아이템3] }) @@for (var i = 0; i html > index.html: @@include('./include/content.html') src > html > about-gulp-file-include.html: @@include('./inclu.. 2021. 1. 9. [템플릿] gulp-file-include 설치 및 gulp-file 설정 1. 설치 npm install --save-dev gulp-file-include 2. gulpfile.js 설정 const gulp = require("gulp"); const fileinclude = require('gulp-file-include'); gulp.task('fileinclude', function() { return gulp.src([ "./src/html/*", // ★★★★ 불러올 파일의 위치 "!" + "./src/html/include*" // ★★★★ 읽지 않고 패스할 파일의 위치 ]) .pipe(fileinclude({ prefix: '@@', basepath: '@file' })) .pipe(gulp.dest('./dist/html')); // ★★★★ 변환한 파일의 저.. 2021. 1. 9. 이전 1 다음