├── webstart ├── build │ ├── css │ │ └── README.md │ ├── es6 │ │ └── README.md │ ├── img │ │ ├── README.md │ │ └── sprite │ │ │ └── README.md │ ├── js │ │ └── README.md │ ├── scss │ │ └── README.md │ └── concat │ │ ├── css │ │ └── README.md │ │ └── js │ │ └── README.md ├── dist │ ├── css │ │ └── README.md │ └── img │ │ └── README.md └── static │ └── index.html ├── .babelrc ├── .gitignore ├── .editorconfig ├── LICENSE ├── README.md ├── CHANGELOG.md ├── package.json └── gulpfile.babel.js /webstart/build/css/README.md: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /webstart/build/es6/README.md: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /webstart/build/img/README.md: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /webstart/build/js/README.md: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /webstart/dist/css/README.md: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /webstart/dist/img/README.md: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /webstart/build/scss/README.md: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /webstart/build/concat/css/README.md: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /webstart/build/concat/js/README.md: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /webstart/build/img/sprite/README.md: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": ["es2015"] 3 | } -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | #忽略node模块 2 | node_modules 3 | 4 | #忽略webstorm的配置文件 5 | idea 6 | 7 | #忽略vscode的配置文件 8 | vscode 9 | 10 | #忽略编译的css 11 | webstart/build/**/*.css 12 | webstart/build/scss/**/*.scss 13 | 14 | 15 | #忽略第三方库,bower安装的 16 | webstart/dist/lib/**/* -------------------------------------------------------------------------------- /webstart/static/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Document 7 | 8 | 9 |
10 |
11 |

第一个页面

12 |
13 |
14 |
15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # EditorConfig helps developers define and maintain consistent 2 | # coding styles between different editors and IDEs 3 | # editorconfig.org 4 | 5 | root = true 6 | 7 | 8 | [*] 9 | [*.{js,scss}] 10 | charset = utf-8 11 | insert_final_newline = true 12 | 13 | # change these settings to your own preference 14 | indent_style = space 15 | indent_size = 2 16 | 17 | [package.json] 18 | indent_style = space 19 | indent_size = 2 20 | 21 | # we recommend you to keep these unchanged 22 | end_of_line = lf 23 | charset = utf-8 24 | trim_trailing_whitespace = true 25 | insert_final_newline = true 26 | 27 | [*.md] 28 | trim_trailing_whitespace = false 29 | 30 | [{package,bower}.json] 31 | indent_style = space 32 | indent_size = 2 33 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 CRPER 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # StartFrontendProject 2 | 3 | #中文 4 | 最基础的配置,没有模块化加载的实现(webpack,Browserify,requrejs,seajs == ), 5 | 可以在这个基础上自行拓展 6 | 7 | ##依赖环境 8 | - node v4.x+ 9 | - python 2.7.x 10 | - (browser-sync 在window下依赖Python 2.x) 11 | - visual studio 2013+ (编译一些插件需要依赖这个)/Linux和mac就不需要这个 12 | 13 | ##用法 14 | **依赖环境必须先安装好,然后打开`terminal`,切换到该项目下** 15 | 16 | 1. 执行`npm install` --- 安装node里面的依赖模块 17 | 18 | **如果喜欢就fork或者star一下吧,有完善的也可以提交~~~** 19 | 20 | ##任务列表 21 | - 编译SCSS -> CSS 22 | - 添加浏览器前缀 23 | - AMD文件优化 24 | - 压缩JS/HTML/CSS/图片 25 | - 合并文件 26 | - JS语法检测 27 | - 添加后缀名 28 | - 浏览器实时预览更新 29 | - 清除文件 30 | - ES6文件转换 31 | - 雪碧图生成 32 | 33 | 34 | 35 | ##目录结构及文件 36 |
37 | └─webstart
38 |     ├─build          ---> 开发目录
39 |     │  ├─css
40 |     │  ├─img
41 |     │  │  └─sprite   --待合并成雪碧图的图片文件
42 |     │  ├─js
43 |     │  ├─scss        -- 待编译的SCSS文件
44 |     │  ├─concat      -- 待合并的文件
45 |     │  └─es6         -- es6语法的JS文件
46 |     ├─dist           ---> 生成目录
47 |     │  ├─img
48 |     │  │  ├─img      -- 压缩过后的图片
49 |     │  │  └─sprite   --合并完成的雪碧图
50 |     │  ├─css
51 |     │  │  └─common
52 |     │  ├─js
53 |     └─static  -- 静态HTML文件存放
54 | 
55 | 56 | 57 | ------------ 58 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | - 2015/10/16:收集了一些实用的插件; 2 | - 2015/10/17: 3 | - 增加了browser-sync监听sass; 4 | - 压缩图片 5 | - 添加了目录路径的定义 6 | - 目录树重新调整 7 | - 2015/10/18 8 | - 一些小细节调整 9 | - 监听生产目录的css及发布目录下的html,刷新浏览器 10 | - 计算文件大小 11 | - 添加了gulp-ignore / gulp-inject 12 | - 2015/10/20 13 | - 完善监听机制 14 | - 添加css合并 15 | - 增加了CSS自动排版及添加前缀功能 16 | - 增加了一些备用模块(gulp-react /gulp-webpack/gulp-webpack-stream) 17 | - 完善压缩图形 18 | - 2015/10/24 19 | - bower初始化新增了几个常用的前端框架(Foundation,semantic-ui) 20 | - 一套基于BS搞的前端模版; 21 | - 监听任务调整 22 | - 增加合并文件输出的时候检查错误 23 | - 添加eslint检测,但是太卡了..注释掉了..有需求的自行开启!! 24 | - 2015/10/25 25 | - 增加了css转换成scss的任务...特别适用准备重构的时候用到; 26 | - 2015/10/26 27 | - 增加了es6转为标准es5的任务,可选项 28 | - 2015/10/30 29 | - 增加了雪碧图的合成 30 | - 改善了browser sync的监听任务,实时监听html,css,scss,js 31 | - 2015/11/03 32 | - 升级bower里面的库为最新版,增加了vue.js及react.js框架 33 | - nodejs使用最新版本v5.0.0,需要`npm rebuild node-sass`,不然gulp会不正常 34 | - 2015/11/05 35 | - 更新了模块和依赖 36 | - 2015/12/7 37 | - 更新了依赖模块,删除了暂时没有用到的模块 38 | - 移除bower安装的库,有需要的自行`bower install` 39 | - 2015/12/31 40 | - 执行了一边`npm update` 41 | - 2016/2/1 42 | - 重写所有执行方法,精简部分不需要的,完善一些任务调用 43 | - 目录树结构重新调整 44 | - 移除没用到的node模块 45 | - 用bower来管理第三方库 46 | - 2016/2/22 47 | - 更新插件 48 | 49 | - 2016/4/27 50 | - 增加gulp-postcss和autoprefixer 51 | - 更新所有模块 52 | - 添加gulp-sequence(队列管理) 53 | - 删除csso压缩模块 54 | - 删除.eslint和.bowerrc的配置文件 55 | - 删除gulp-notify模块 56 | - 移除bower管理 57 | 58 | - 2016/5/1 59 | - 移除gulp-autoprefixer,采用autoprefixer 60 | - gulpfile改用es6写法,用babel编译; 61 | - 写法上的优化 62 | - 增加gulp-filter 63 | 64 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "author": "CRPERLIN ", 3 | "repository": { 4 | "type": "git", 5 | "url": "git+https://github.com/crperlin/StartFrontendProject.git" 6 | }, 7 | "private": true, 8 | "engines": { 9 | "node": "^4.0.0" 10 | }, 11 | "devDependencies": { 12 | "autoprefixer": "^6.3.6", 13 | "babel-core": "^6.8.0", 14 | "babel-preset-es2015": "^6.6.0", 15 | "babel-register": "^6.8.0", 16 | "brace-expansion": "^1.1.4", 17 | "browser-sync": "^2.12.8", 18 | "gulp": "^3.9.1", 19 | "gulp-amd-optimizer": "^0.4.0", 20 | "gulp-babel": "^6.1.2", 21 | "gulp-concat": "^2.6.0", 22 | "gulp-cssnano": "^2.1.2", 23 | "gulp-filter": "^4.0.0", 24 | "gulp-if": "^2.0.1", 25 | "gulp-imagemin": "^3.0.1", 26 | "gulp-jshint": "^2.0.1", 27 | "gulp-plumber": "^1.1.0", 28 | "gulp-postcss": "^6.1.1", 29 | "gulp-rename": "^1.2.2", 30 | "gulp-rimraf": "^0.2.0", 31 | "gulp-sass": "^2.3.1", 32 | "gulp-sequence": "^0.4.5", 33 | "gulp-size": "^2.1.0", 34 | "gulp-sourcemaps": "^1.6.0", 35 | "gulp-uglify": "^1.5.3", 36 | "gulp.spritesmith": "^6.2.1", 37 | "imagemin-jpegtran": "^5.0.0", 38 | "imagemin-pngquant": "^5.0.0", 39 | "imagemin-svgo": "^5.1.0", 40 | "inflight": "^1.0.4", 41 | "jshint": "^2.9.2", 42 | "lodash": "^4.12.0", 43 | "merge-stream": "^1.0.0", 44 | "vinyl-buffer": "^1.0.0", 45 | "vinyl-fs": "^2.4.3" 46 | }, 47 | "dependencies": {}, 48 | "name": "StartFrontendProject", 49 | "bugs": { 50 | "url": "https://github.com/crperlin/StartFrontendProject/issues" 51 | }, 52 | "homepage": "https://github.com/crperlin/StartFrontendProject#readme", 53 | "version": "1.6.0", 54 | "main": "index.js", 55 | "scripts": { 56 | "test": "echo \"Error: no test specified\" && exit 1" 57 | }, 58 | "license": "MIT", 59 | "description": "" 60 | } 61 | -------------------------------------------------------------------------------- /gulpfile.babel.js: -------------------------------------------------------------------------------- 1 | /** 2 | * cnpm install gulp imagemin-svgo gulp-notify gulp-babel babel-preset-es2015 gulp.spritesmith vinyl-buffer gulp-postcss autoprefixer gulp-amd-optimizer gulp-plumber gulp-notify gulp-sourcemaps gulp-jshint gulp-uglify gulp-sass gulp-cssnano gulp-autoprefixer gulp-ifnpm gulp-size gulp-concat gulp-rimraf gulp-rename gulp-postcss gulp-scss-lint gulp-imagemin browser-sync --save-dev 3 | */ 4 | 5 | 6 | 'use strict'; 7 | 8 | import gulp from "gulp"; //gulp 9 | import sass from "gulp-sass"; //sass编译 10 | import concat from "gulp-concat"; //合并JS 11 | import uglify from "gulp-uglify"; //压缩JS 12 | import gulpif from "gulp-if"; //增加判断 13 | import sequence from "gulp-sequence"; //队列 14 | import cssnano from "gulp-cssnano"; //压缩CSS 15 | import imagemin from "gulp-imagemin"; //压缩图片 16 | import pngquant from "imagemin-pngquant"; //深度压缩图片 17 | import rimraf from "gulp-rimraf"; //清除文件 18 | import rename from "gulp-rename"; //重命名 19 | import plumber from "gulp-plumber"; //错误提示 20 | import amdOptimize from "gulp-amd-optimizer"; //requirejs 压缩 21 | import sourcemaps from "gulp-sourcemaps"; //sourcemaps 22 | import spritesmith from "gulp.spritesmith"; //雪碧图 23 | import bf from "vinyl-buffer"; //流缓存 24 | import postcss from "gulp-postcss"; //css处理 25 | import merge from "merge-stream"; //合并流 26 | import babel from "gulp-babel"; //es6转化为es5 27 | import autoprefixer from "autoprefixer"; //添加浏览器前缀 28 | import jshint from "gulp-jshint"; //js语法检测 29 | import filter from "gulp-filter"; //过滤器 30 | import bsc from "browser-sync"; 31 | 32 | const bs = bsc.create(), //即时预览 33 | bs_reload = bs.reload; //即时预览重载 34 | 35 | 36 | 37 | 38 | /** 39 | * 路径变量( s => source , d => distribute , o => other project) 40 | */ 41 | var current = false, //变化路径的开关,true开启,false关闭 42 | o_dist = 'F://LQH/WORK/Anzipay-mall/oneyuan/dist/', //其他项目的根目录 43 | o_css = o_dist + 'css/', //其他项目下的CSS 44 | o_js = o_dist + 'js/', //其他项目下的JS 45 | o_img = o_dist + 'img/', //其他项目下的IMG 46 | o_mod = o_dist + 'mod/', //其他目录下的模块 47 | build = "webstart/build/", //开发目录 48 | dist = "webstart/dist/", //输出目录 49 | path = { 50 | 51 | s_sass : build +"scss/", //待编译的源文件路径 52 | s_css : build +"css/", 53 | s_js : build +"js/", 54 | s_es : build +"es6/", //待转换的ES6文件 55 | s_img : build +"img/", //待压缩的图片 56 | s_simg : build +"img/sprite/", //待合并成雪碧图的文件 57 | s_c_js : build + "concat/js/", //待合并的JS 58 | s_c_css : build + "concat/css/", //待合并的CSS 59 | d_css : dist+"css/", //输出的文件 60 | d_img : dist+'img/', 61 | d_js : dist+'js/', 62 | server_root : ["webstart/static","webstart/static/SS/"], //静态服务器根目录,可以传入多个目录 63 | o_dist : o_dist, 64 | o_css : o_css, //其他项目输出文件 65 | o_js : o_js, 66 | o_img : o_img, 67 | o_mod : o_mod, 68 | selectPath : (current) => { //开始替换路径 69 | if (current) { 70 | path.d_css = path.o_css; 71 | path.d_img = path.o_img; 72 | path.d_js = path.o_js; 73 | path.d_mod = path.o_mod; 74 | path.server_root = path.o_dist; //本地服务器启动根目录 75 | } 76 | } 77 | }; 78 | path.selectPath(current); 79 | 80 | 81 | 82 | gulp.task('help',() => { 83 | 84 | console.log("scss_2_cs : SCSS文件编译为CSS文件到开发目录"); 85 | console.log("cssmin : 压缩CSS文件到生产目录"); 86 | console.log("uglify : 压缩JS文件到生产目录"); 87 | console.log("imagemin : 压缩png文件到生产目录"); 88 | console.log("sprite : 雪碧图生成到生成目录"); 89 | console.log("es6_2_es5 : es6转为ES5"); 90 | console.log("serve : 本地静态服务器"); 91 | console.log("rimraf : 删除生成目录所有文件"); 92 | }); 93 | 94 | /*合并文件*/ 95 | gulp.task('concat_js',() => { 96 | return gulp.src(path.s_c_js +'**/**/*.js') 97 | .pipe(concat('concat_js.js',{ 98 | newLine:';' 99 | })) 100 | .pipe(gulp.dest(path.s_js)); 101 | }); 102 | 103 | gulp.task('concat_css',() => { 104 | return gulp.src(path.s_c_css +'**/**/*.css') 105 | .pipe(concat('concat_css.css')) 106 | .pipe(gulp.dest(path.s_css)); 107 | }); 108 | 109 | 110 | 111 | 112 | /** 113 | * sass 语法检测及文件处理 114 | */ 115 | gulp.task('scss_2_css', () => { 116 | return gulp.src(path.s_sass + '**/*.scss') 117 | .pipe(plumber()) 118 | .pipe(sass.sync().on('error', sass.logError)) 119 | .pipe(plumber.stop()) 120 | .pipe(postcss([ autoprefixer({ browsers: ['last 3 versions'] }) ])) 121 | .pipe(gulp.dest(path.s_css)); 122 | }); 123 | 124 | //脚本检查 125 | gulp.task('lint', () => { 126 | return gulp.src([path.d_js + '**/**/*.js',path.s_js + '**/**/*.js' , path.c_js + '**/**/*.js' ]) 127 | .pipe(jshint()) 128 | .pipe(jshint.reporter('default')); 129 | 130 | }); 131 | 132 | 133 | /** 134 | * 压缩css 135 | */ 136 | gulp.task('cssmin', () => { //执行完sass再执行cssmin 137 | return gulp.src(path.s_css + '**/**/*.css') 138 | .pipe(plumber()) 139 | .pipe(sourcemaps.init()) //sourcemapr入口 140 | .pipe(rename({ 141 | // dirname: "main/text/ciao", //目录名 142 | // basename: "aloha", //基本命名 143 | // prefix: "bonjour-", //前缀 144 | suffix: ".min" //后缀 145 | // extname: ".md" //拓展名 146 | })) 147 | .pipe(cssnano()) 148 | .pipe(sourcemaps.write('.')) //保存到输出map 149 | .pipe(gulp.dest(path.d_css)); 150 | 151 | }); 152 | 153 | 154 | /** 155 | * 压缩js 156 | */ 157 | gulp.task('uglify', () => { 158 | return gulp.src(path.s_js + '**/**/*.js') //'!src/static/js/main/*js' 不压缩 159 | .pipe(plumber()) 160 | .pipe(rename({ 161 | // dirname: "main/text/ciao", //目录名 162 | // basename: "aloha", //基本命名 163 | // prefix: "bonjour-", //前缀 164 | suffix: ".min" //后缀 165 | // extname: ".md" //拓展名 166 | })) 167 | .pipe(uglify({ 168 | mangle: true, //类型:Boolean 默认:true 是否修改变量名 169 | compress: true //类型:Boolean 默认:true 是否完全压缩 170 | })) 171 | .pipe(gulp.dest(path.d_js)); 172 | 173 | }); 174 | 175 | 176 | 177 | 178 | /** 179 | * 图片压缩 180 | */ 181 | gulp.task('imagemin', () => { 182 | return gulp.src(path.s_img + '*') 183 | .pipe(plumber()) 184 | .pipe(imagemin({ 185 | progressive: true, 186 | svgoPlugins: [{ 187 | removeViewBox: false 188 | }], 189 | use: [pngquant()] 190 | })) 191 | .pipe(gulp.dest(path.d_img)); 192 | 193 | }); 194 | 195 | //雪碧图 196 | gulp.task('sprite', () => { 197 | // Generate our spritesheet 198 | var spriteData = gulp.src(path.s_simg+'*.png').pipe(spritesmith({ 199 | imgName: 'sprite.png', 200 | cssName: 'sprite.css' 201 | })); 202 | 203 | // Pipe image stream through image optimizer and onto disk 204 | var imgStream = spriteData.img 205 | // DEV: We must buffer our stream into a Buffer for `imagemin` 206 | .pipe(bf()) 207 | .pipe(imagemin()) //压缩合并的图片 208 | .pipe(gulp.dest(path.d_img)); 209 | 210 | // Pipe CSS stream through CSS optimizer and onto disk 211 | var cssStream = spriteData.css 212 | .pipe(gulp.dest(path.d_css)); 213 | 214 | // Return a merged stream to handle both `end` events 215 | return merge(imgStream, cssStream); 216 | }); 217 | 218 | /** 219 | * 清空图片、样式、js 220 | */ 221 | gulp.task('rimraf', () => { 222 | return gulp.src([path.d_css + '**/**/*',path.d_js + '**/*'], { 223 | read: false 224 | }) // much faster 225 | .pipe(plumber()) 226 | .pipe(rimraf({ 227 | force: true 228 | })); 229 | 230 | }); 231 | 232 | /** 233 | *AMD 模块压缩 234 | */ 235 | gulp.task('amdop', () => { 236 | return gulp.src(path.d_js + '**/**/*.js', {base: amdConfig.baseUrl}) 237 | .pipe(plumber()) 238 | .pipe(sourcemaps.init()) 239 | .pipe(amdOptimize(amdConfig)) 240 | .pipe(concat('modules.js')) 241 | .pipe(sourcemaps.write('./')) 242 | .pipe(gulp.dest(path.d_js)); 243 | 244 | }); 245 | var amdConfig = { 246 | baseUrl: '', 247 | path: { 248 | //object 249 | }, 250 | exclude: [ 251 | 'jQuery' 252 | ] 253 | }; 254 | 255 | 256 | /** 257 | *本地服务器 258 | */ 259 | gulp.task('serve', () => { 260 | // 从这个项目的根目录启动服务器 261 | bs.init({ 262 | server: { 263 | baseDir: path.server_root //本地服务器目录 264 | }, 265 | port:1234 266 | }); 267 | gulp.watch([path.server_root + '**/**/*.html', 268 | path.d_css + '**/**/*.css', 269 | path.s_img + '*', 270 | path.d_js + '**/**/*.js']).on("change", bs_reload); 271 | }); 272 | 273 | 274 | 275 | /*队列管理*/ 276 | gulp.task('default-sequence',(cb) => { 277 | sequence(['concat_css','concat_js'],['scss_2_css', 'cssmin'], ['es6_2_es5','uglify'], ['sprite','imagemin'], 'serve','watch', cb); 278 | }); 279 | 280 | 281 | 282 | 283 | /** 284 | * 默认任务 运行语句 gulp 285 | */ 286 | gulp.task('default', () => { 287 | return gulp.start('default-sequence'); 288 | }); 289 | 290 | /** 291 | * ES6 转化为ES5 292 | */ 293 | gulp.task('es6_2_es5', () => { 294 | return gulp.src(path.s_es+'**/**/*.js') 295 | .pipe(plumber()) 296 | .pipe(babel({ 297 | presets: ['es2015'] 298 | })) 299 | .pipe(gulp.dest(path.s_js)); 300 | 301 | }); 302 | 303 | /** 304 | * 监听任务 运行语句 gulp watch 305 | */ 306 | gulp.task('watch', () => { 307 | 308 | // 监听sass 309 | gulp.watch(path.s_sass + '**/*.scss', ['scss_2_css']); 310 | 311 | // 监听css 312 | gulp.watch(path.s_css + '**/**/*.css', ['cssmin']); 313 | 314 | // 监听images 315 | gulp.watch(path.s_img + '*', ['imagemin']); 316 | 317 | //监听ES6 JS 318 | gulp.watch(path.s_es+'**/**/*.js',['es6_2_es5']); 319 | 320 | // 监听js 321 | gulp.watch(path.d_js + '**/*.js', ['uglify']); 322 | 323 | 324 | }); --------------------------------------------------------------------------------