{"body":"var gulp = require('gulp');\nvar concat = require('gulp-concat');\nvar server = require('gulp-express');\n//var uglifyjs = require('gulp-uglifyjs');\n//var imagemin = require('gulp-imagemin');\n//var minifyCSS = require('gulp-minify-css');\n//var del = require('del');\n\nvar appName = 'your_proj';\n\nvar Path = {\n\ttemplate: 'script/**/*.html',\n\tindex: 'index.html',\n\tscript: 'script/**/*.js',\n\t\n\tmodule: 'script/**/*.module.js',\n\tnotmodule: 'script/**/*.!(module).js',\n\t//vendor: '../../bower_components/',\n\tall: '**/*',\n\tcss: 'script/**/*.css', \n\timage: 'img/**/*', // could exclude !psd\n\tserverBase: '../../server/'+appName,\n\tserverPublic: '../../server/'+appName +'/public',\n};\n\n// this works because we have no index file - any html are templates from routes\ngulp.task('template',function() {\n\treturn gulp.src(Path.template)\n\t.pipe(gulp.dest(Path.serverPublic+'/template'));\n\n});\ngulp.task('index',function() {\n\treturn gulp.src('index.html')\n\t.pipe(gulp.dest(Path.serverPublic));\n\n});\ngulp.task('css',function() {\n\treturn gulp.src(Path.css)\n\t.pipe(concat('main.css'))\n\t.pipe(gulp.dest(Path.serverPublic));\n\n});\n\ngulp.task('image',function() {\n\treturn gulp.src(Path.image)\n\t.pipe(gulp.dest(Path.serverPublic+'/image'));\n\n});\n\ngulp.task('bower',function() {\n\treturn gulp.src('bower.json')\n\t.pipe(gulp.dest(Path.serverPublic));\n\n});\n\ngulp.task('script',['module-script','notmodule-script']);\ngulp.task('module-script',function() {\n\treturn gulp.src(Path.module)\n\t.pipe(concat('module.js'))\n\t.pipe(gulp.dest(Path.serverPublic+'/template'));\n\n});\ngulp.task('notmodule-script',function() {\n\treturn gulp.src(Path.notmodule)\n\t.pipe(concat('notmodule.js'))\n\t.pipe(gulp.dest(Path.serverPublic+'/template'));\n\n});\n\ngulp.task('start-all',function() {\n\tserver.run({\n        file: Path.serverBase + '/app.js',\n\t\tport: 35729\n    });\n\t\n\t\n    gulp.watch([Path.css], ['css']);\n    gulp.watch([Path.script],['script']);\n\tgulp.watch([Path.image], ['image']);\t\n\tgulp.watch([Path.template], ['template']);\n\tgulp.watch([Path.index], ['index']);\n\t//gulp.watch([Path.serverBase + '/routes/**/*.js'],server.run);\n\n    gulp.watch([Path.serverPublic + '/template/**/*.html'], server.notify);\n    gulp.watch([Path.serverPublic + '/**/*.css'], server.notify);\n    gulp.watch([Path.serverPublic + '/template/**/*.js'],server.notify);\n\tgulp.watch([Path.serverPublic + '/images/**/*'], server.notify);\t\n\tgulp.watch([Path.serverPublic + '/bower_components/**/*'], server.notify);\n\tgulp.watch([Path.serverBase + '/routes/**/*.js'],server.run);\n\t\n\t// TODO: watch bower folder, on change, copy bower.json and rerun bower install\n    \n});\n\ngulp.task('copy-all-simple',['template','css','script','image','index','bower']);\n\ngulp.task('copy-all',function() {\n\treturn gulp.src(Path.all)\n\t.pipe(gulp.dest(Path.serverPublic));\n\n});\n\n\n//gulp.task('default',['script','css','html']);\n//gulp.task('default',['copy-all']);\ngulp.task('default',['copy-all-simple','start-all']);","name":"","extension":"","url":"https://www.irccloud.com/pastebin/HyuX7erd","modified":1416519939,"id":"HyuX7erd","size":2924,"lines":106,"own_paste":false,"theme":"","date":1416519939}