一、准备工作
1、gulp是基于nodeJS的前端构建工具,所以全局安装nodeJS
2、利用npm全局安装gulp。
npm install -g gulp
3、在项目根目录下新建文件package.json。
注意:需要加上一对花括号。
4、在项目根目录下安装本地gulp。
npm install --save-dev gulp
安装好后就会生成node_modules文件夹。
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAM0AAACRCAIAAADvkquyAAAQE0lEQVR4nO2da3QT153A8yUbti17fHYT2o/Zxt4DTbo5pycnTfth9tuWrNJ2N9NQ0h4HA+W4sYSPAZNQY8dj7KyFBpxkC6mBOpiHhLecJLYxtgQWjIjq0sdGOGB7bB4CQvBkS4KEZckWZmc/zFPSHb11fS3/dX4f7ozuy8yPe2c09z/zkDg3LdHZ2SlGBQAoBA+BZwAGEJ49mBXGb395bmLKNTINAHkB4dmlTwNjt8OhSPjBHADkB4Rng2OhaDQ8F52aiwYBIC8gPHONTD+YC9+PBnNkYKC3NunHOXAi91aABQHas7n7uXo2MNBrs+0M3J00yhC4O2mz7TRWjT9iqTniVzb9jnUWx7WYDFyziaaMsHGZ95lrNrGe+T4exQras/v3w7Ozwazp708xkuk/AwMnEJVcc6yzcbOz/GELQqMdHyXtwEcsZeMy7za3w8RyOfzVQBKMPZsJZk36kkmfhBr4w2aWmwnOnmPXHeNnZ7gdZscVVEOcjaZM9I5zsfvPsZSNy7zb3A4Ty+XwVwNJQHsWvR+OzAST4zp1srW1FfmV3iGWZdU0wzD6tLoZX8M5tulcMDLDdx7jLh+r0Y1k7BlUc2dsNGWi1x7j1eKUjUvZ/wS4JoP6gdxBezYbDYcjwST0D5xY8a0VZWWlyG/1komi2NfXJ6UjkYg+7Xa7pWxxxd07JatqOq9Im1KC7zSz7qS9kvGw1E5O2eSaTEptDpYyOyYiwfAVx1qTUpWW5prkBN9ppps8akG6yZNGo0BS0J7NzIanw0Ej+vtPrFixYvXq1WVlpcgM+kFLdcvn84miODQ0VFtbOzQ0FIlE1PEMUcllflxOONaaHePh4HSYP2hm3ca9mg4Hx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/dsTumZuaEy4WxaGjloykSvaqjUBhXtBF85jdOGQ2lqq9ybumzsdUDiRUOiZ6O79zYoc6vyvyLZdQB4VjjPut3bf13/b5uffczy5NLNzz5WZyrb8+Z/SBnSnjdxkXy6VEGc/i8WyPUsCQR41sxsiPk9Ip1fHLr2lKelYzFCpmdfefWJRzRKH4nZfOKRjd/6mkFZjOOZbn5MLZl8HbpIB7NBMj0Dig/wDMABeAbgAOJQAByAZwAOwDMAB/8PZGbTXCUlQYEAAAAASUVORK5CYII=" alt="" />
5、在项目根目录下安装其他插件。
npm install --save-dev gulp-less
npm install --save-dev gulp-watch
npm install --save-dev require-dir
...
...
注意:为什么要加--save-dev?
因为node插件包相对来说非常庞大,所以不加入版本管理,将配置信息写入package.json并将其加入版本管理,其他开发者对应下载即可(命令提示符执行npm install,则会根据package.json下载所有需要的包。
安装好后,node_modules文件夹如下:
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAALwAAADiCAIAAAB7rzp7AAAQOElEQVR4nO2dT2wbVR7HfeGeA9JyROLPol1p94L26D1u0RznUk5NiJBQHUXelbJEqy5xWqvr2trQSrC4pcFx2jFZCWhZ/sVAWnsZRBdWkBRapmkbJ6U0UyhthjYpZEHew4zn75s/L5nx+Nlf6XN4mXnz+73xfPPe2PP1z4nmpgwAFYnYRwCYA6IB1EA0gBqIBlAD0QBqIBpATYSiWZNml6f61qTZSOKLueRQeaXNr5dP0mqWy4ltHlIcRCia5am+tTOPLE/1RRIfoomPCEUzn+lbnuqLarKBaOLDXzSn33stl9vvevyTs7/b89pvM288sq96X+HDvmc/vuf5zxNPzjb15an2yHIxgskGookPH9HMVV/59a9++fBDD7h1+MUf9hBR985n+tZq90sH3URTzXLDwkwuyfFJjh+cWTBt55Ma5stg3s6brp+x3RTEkUgsD3J8kuOzotwUt5e0UR7U+xhts2gIQ1qZGSbFZw8v0aiK2blzp4dompvyb57vd0NdoaSDbitUNcvxyXy19dIPCw1to3EtxVzSuCR8VtSOFfO6aKpZ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IJgRY9whbfXetPhafl/lwU1k1ctXgalYdYWTFzNoPPML2sRkuOzE3ODSsCqilJNdivqbSec6qweaiwN0w68AjLFsmLZNHWMwPC41qdqi8oteA1VXlVsyX4LOxlZqGaNxFw7BHWLu0JrmI5UHT2uRVzBei2bJo2PYIq27wIW2RUtvOr6S4FA4mVg2GaAKIhnWPsBpcu/akb/bb7MNaUvudsrOqNETjQk94hHsbeIQBNcw+sEQd4fhgVjQgPiAaQA1EA6iBaAA1EA2gBqIB1EA0gJr47Z7Re4QDEKJpgfQLl11G/KKJ3iMcAIiGhl7wCLeXLqri6UYveITbC0SzBdriETa5fcnOXLWb+XeRPS2hdkeVb2Qb3omcMdmGUY+w1e1r96wYJk7Tb6ZTiMYvMkExnolsMZmHTY+w7fqJuaT5H12dEqgsoUTvpltkm6fYP1G3PV1n0yPsvLTOaT8s0fguKBDN9mmLR9h2GWwLhGflX6KP2PUCEyPb8P0+DUQTQDTRe4Qdl8H+HTa5uWleXPx8xB4XmBjZBjERRBOcGDzCQeiBd8Jtg1GPMD0QTXj0zANLiCY8ekY0IDwgGkANRAOogWgANRANoAaiAdT8HyxwEOKbo4+nAAAAAElFTkSuQmCC" alt="" />
package.json文件如下:
{
"devDependencies": {
"gulp": "^3.9.1",
"gulp-autoprefixer": "^3.1.1",
"gulp-concat": "^2.6.0",
"gulp-htmlmin": "^3.0.0",
"gulp-less": "^3.1.0",
"gulp-minify-css": "^1.2.4",
"gulp-sourcemaps": "^2.2.0",
"gulp-uglify": "^2.0.0",
"gulp-watch": "^4.3.10",
"htmlmin": "0.0.7",
"require-dir": "^0.3.1"
...
}
}
6、在根目录下新建gulp文件夹,以及gulpfile.js文件。
a)在gulp文件下新建tasks文件夹以及config.js文件。
b)tasks下面新建不同的js文件,代表不同的任务。
c)config.js配置任务的相关配置。