前言:gulp將header/footer引入頁面 這是使用fs、gulp-replace的一個方法,比較麻煩,每新增一個模組,就要寫一個引入。也有其他更為簡單的方法,gulp-file-include更為的簡單簡略,使用很久了,感覺不錯,記錄之。 1、引入外掛




1:不用寫fs,哪裡需要引入就直接include,簡單、簡略、好用。
2:生成後的dist檔案中,保留了原先引入的模板header、footer、nav、sidebar等等,方便查閱修改,更重要的是方便後臺程式猿拿來直接使用
前言:gulp將header/footer引入頁面 這是使用fs、gulp-replace的一個方法,比較麻煩,每新增一個模組,就要寫一個引入。也有其他更為簡單的方法,gulp-file-include更為的簡單簡略,使用很久了,感覺不錯,記錄之。 1、引入外掛
1:不用寫fs,哪裡需要引入就直接include,簡單、簡略、好用。
2:生成後的dist檔案中,保留了原先引入的模板header、footer、nav、sidebar等等,方便查閱修改,更重要的是方便後臺程式猿拿來直接使用