gulp.task('serve', ['build'], function () { var server = gls('dist/server.js', undefined, false); var worker = gls('dist/worker.js', undefined, false); server.start(); worker.start(); gulp.watch(config.watchFiles, function () { runSequence('compile', function() { server.start.bind(server)(); worker.start.bind(worker)(); }); }); });
gulp.task('start-simulators', () => { foxboxSimulator = gls( `${TESTS_ROOT}foxbox-simulator/http-server.js`, undefined, false ); foxboxSimulator.start(); registrationServerSimulator = gls( `${TESTS_ROOT}registration-server-simulator/http-server.js`, undefined, false ); registrationServerSimulator.start(); });
gulp.task('server', function() { var server = gls('./src/index.js', {}); server.start(); gulp.watch(['gulpfile.js', './src/index.js'], function() { server.start.bind(server)(); }); });
gulp.task('dev', ['build'], () => { let server = gls('./index.js', { cwd: 'dist', }); server.start(); //wait for some stdout from server to launch browser server.server.stdout.on('data', (message) => { gutil.log(message); gulp.src(__filename).pipe( gopen({ uri: 'http://localhost:3000' }) ); }); gulp.watch(['src/graphics/**/*.js', 'src/index.js'], ['server']); gulp.watch(['src/static/**/*.html'], ['html']); gulp.watch(['src/graphics/**/*.js', 'src/static/js/**/*.js'], ['browserify']); gulp.watch(['dist/static/**/*'], (file) => { server.notify.apply(server, [file]); }); gulp.watch(['dist/index.js', 'dist/graphics/*'], function(){ server.start.bind(server)(); }); });
gulp.task('serve', function () { var server = gls(['--harmony', '.bone/serve.js'], {env: {NODE_ENV: 'dev'}}, devConf.serverLrPort); server.start(); // Restart server when server code changed. gulp.watch([ '.bone/**/*', 'config/**/*', resolveBySites([ '/**/*.common.js', '/**/*.server.js', '/**/*.json', '/server/**/*.js' ]), ], function( args ){ console.error('Reloading Server.'); server.start().then(function(){ console.error('Server Reloaded.'); livereload.changed( args.path ); }); }); // Livereload for JS gulp.watch([ resolveBySites([ '/**/*.html' ]), ], function( args ){ console.error('Reload HTML.'); livereload.changed( args.path ); }); // Livereload for CSS gulp.watch([ resolveBySites([ '/**/*.scss', '/**/*.sass' ]), ], function( args ){ console.error('Reload CSS.'); livereload.changed( args.path.replace(/.s[ca]ss$/i,'.css') ); }); // Livereload for Client JS & other resources gulp.watch([ resolveBySites( '/**/*' ), resolveExcludeBySites([ '/**/*.html', '/**/*.common.js', '/**/*.server.js', '/**/*.json', '/server/**/*.js', '/**/*.scss', '/**/*.sass', ]), ], function( args ){ console.error('Reload Browser.'); livereload.changed( args.path ); }); // Watch static files livereload.listen({ port: devConf.clientLrPort }); });
gulp.task('server', function() { var server = gls('./src/index.js', {NODE_ENV: 'development', PORT: 2666}); server.start(); gulp.watch(['gulpfile.js', '.src/index.js', './src/controllers/**/*.js'], function() { server.start.bind(server)() }); });
gulp.task('server', function() { var server = gls('./src/app.js', {NODE_ENV: 'development', PORT: 3000}); server.start(); // Start the server gulp.watch(['gulpfile.js', './src/app.js', './src/controllers/**/*.js'], function() { server.start.bind(server)() }); });
gulp.task('default', ['init-browser-sync'], () => { server = gls(serverUrl); server.start(); gulp.watch(serverUrl, () => { server.start.bind(server)(); }); gulp.watch('src/**/*', ['write-and-clean-then-reload']); });
gulp.task('server', function() { var server = gls('./src/index.js', {NODE_ENV: 'development', PORT: 3000}); // finds the local port server.start(); // starts the server running gulp.watch(['gulpfile.js', './src/index.js', './src/controllers/**/*.js'], function() { // indicates which files will be watched server.start.bind(server)() }); });
gulp.task('server', function () { //customize livereload server, e.g. port number var server = gls('src/app.js', undefined, false); server.start(); //use gulp.watch to trigger server actions(notify, start or stop) gulp.watch(src.js, server.start); //restart my server gulp.watch(src.ts, ['build:ts']); });
gulp.task('server', () => { let server = gls('./server/app.js', { env: config }); server.start(); // Reload the server on change gulp.watch(['./gulpfile.js', './server/app.js', './server/{config,controllers,lib,middleware,models}/**/*.js'], function() { server.start.bind(server)() }); });
gulp.task('server', function () { var env = process.env; env.NODE_ENV = process.env.NODE_ENV || 'development'; var server = gls('bin/www', env, false); server.start(); gulp.watch(['app.js', 'bin/www', 'routes/**/*.js'], [server.start]); });
gulp.task('serve:release', function () { var options = { cwd: undefined }; options.env = process.env; options.env.NODE_ENV = 'production'; // var server = gls('./server.js', options); var server = gls(['./server.js', 'release'], options); server.start(); });
gulp.task('server', function() { var server = gls('.'); server.start().then(function(result) { gutil.log('Server exited with result:', result); }); return gulp.watch(expressSrcFiles, function(file) { gutil.log(file); server.start.apply(server); }); });
gulp.task('live-server', () => { const gls = require('gulp-live-server'); const server = gls([gls.script, destinationFolder, port], undefined, liveReloadPort); server.start(); gulp.watch([destinationFolder + '/**/*.**'], function (file) { server.notify.apply(server, [file]); }); });
gulp.task('watch', ['clean', 'build'], () => { let server = LiveServer(`${buildDir}/server.js`); server.start(); browserSync.init(null, { proxy: 'http://localhost:9000' }); gulp.watch(`${clientDir}/**/*.jade`, ['build:client']); gulp.watch(`${clientDir}/**/*.jsx`, ['scripts', 'copy:app']); gulp.watch(`${clientDir}/content/styles/**/*.scss`, ['styles:client']); gulp.watch('step-templates/*.json', ['step-templates']); gulp.watch(`${buildDir}/**/*.*`).on('change', reload); });
gulp.task('serve', function () { var options = { cwd: undefined }; options.env = process.env; options.env.NODE_ENV = 'development'; var server = gls('./server.js', options); // setTimeout(function sleepServerFirst() { server.start(); // gutil.log(gutil.colors.green('✔'), gutil.colors.green.bold('Server start')); // }, 60000); gulp.watch(['static/**/*.css', 'static/**/*.html'], function () { server.notify.apply(server, arguments); }); });
gulp.task('default', function() { var server = gls('index.js', { env: { NODE_ENV: 'development' } }); server.start(); //use gulp.watch to trigger server actions(notify, start or stop) gulp.watch(['./static/index.css', 'index.html'], function(file) { server.notify.apply(server, [file]); }); // Note: try wrapping in a function if getting an error like `TypeError: Bad argument at TypeError (native) at ChildProcess.spawn` gulp.watch(['index.js'], function() { server.start.bind(server)() }); });
gulp.task('default', () => { const server = gls('server/server.js', {env: {NODE_ENV: 'development'}}, 8081); server.start(); // watch the assets gulp.watch(['public/**/*'], (file) => { console.log(`Changed asset: ${file}`); server.notify.apply(server, [file]); }); // watch the client files gulp.watch(['./index.html', './*.js', 'client/**/**/**/*.js', 'client/**/**/**/*.html', 'client/**/**/**/*.css'], (file) => { console.log(`Changed client file: ${file.path}`); server.notify.apply(server, [file]); }); // watch the server files gulp.watch(['server/**/*.js'], (file) => { console.log(`Changed server file: ${file.path}`); server.start.bind(server)(); }); });
.pipe(gulp.dest('src/static/js')); }); gulp.task('minify-css', function () { return gulp.src('src/static/stylesheets/style.css') .pipe(minifyCss()) .pipe(rename('style.min.css')) .pipe(gulp.dest('src/static/stylesheets')); }); gulp.task('build', ['minify-js', 'minify-css']); var server = gls('src/node/minutedock.js', { env: { NODE_ENV: 'test', NODE_CONFIG_DIR: 'config', NODE_CONFIG: process.env.NODE_CONFIG || {} } }); gulp.task('serve', function () { server.start(); gulp.watch(['src/**/*'], function () { server.start.apply(server); }); }); gulp.task('test', ['build', 'serve'], function () { return gulp.src(['./test/**/*.js']) .pipe(protractor({ 'configFile': 'test/conf.js',
gulp.task('serve', function(){ var server = gls('index.js', {env: {NODE_ENV: 'development'}}); server.start(); gulp.watch(['*.js', 'routes/*.js', 'models/*.js'], server.start); });
var _ = require('lodash'); var mainBowerFiles = require('main-bower-files'); var inject = require('gulp-inject'); var options = { NODE_ENV: 'development', PORT: 9000, ROOT_DIR: __dirname, CLIENT_ROOT: path.join(__dirname, 'client'), SERVER_ROOT: path.join(__dirname, 'server') }; gulp.task('serve', ['inject', 'server', 'client']); var server = gls('server/app.js', {env: options}); gulp.task('server', function() { // restart, livereload server server.start(); gulp.watch(['server/**/*.js'], server.start); gulp.watch(['server/**/*.js'], server.notify); }); gulp.task('client', function() { gulp.watch(['client/index.html'], server.notify); gulp.watch(['client/app.css'], server.notify); gulp.watch(['client/jquery/**/*.js'], server.notify); gulp.watch(['client/jquery/**/*.html'], server.notify); gulp.watch(['client/angular/**/*.js'], server.notify); gulp.watch(['client/angular/**/*.html'], server.notify);
}); gulp.task('uglify-prod', () => { return gulp.src('pub/bundle.js').pipe(uglify({ mangle: true, compress: true })).pipe(gulp.dest('pub')); }); gulp.task('build-prod', (done) => { runSequence('webpack-prod', 'uglify-prod', done); }); const server = gls('server/js/app.js', { env: { NODE_ENV: 'development' } }, 5000); gulp.task('ts', () => { const tsProject = ts.createProject('src/ts/server/tsconfig.json'); const tsResult = tsProject.src().pipe(ts(tsProject)); return merge([ tsResult.dts.pipe(gulp.dest('server/definitions')), tsResult.js.pipe(gulp.dest('server/js')) ]); }); gulp.task('serve', ['ts'], () => { server.start(); });
module.exports = function(gulp, options) { gulp.task('dist:docs', function() { return gulp.src('./docs/gulpfile.js', { read: false }).pipe(chug({ tasks: ['dist'], args: ['--skipPreprocess'] })); }); var server = gls('./server/server.js', {env: {SILENT_MODE: true}}); gulp.task('start:docs', ['dist:docs'], function() { server.start(); }); gulp.task('stop:docs', function() { server.stop(); }); var onError = function() { server.stop(); }; /** ** Windows e2e matrix **/ gulp.task('integration:windows:ie', function() { return GrommetTestUtils.runIntegration(gulp, options.e2ePaths, onError, { platform: 'Windows 7', browserName: 'internet explorer', version: '11.0' }); }); gulp.task('integration:windows:chrome', function() { return GrommetTestUtils.runIntegration(gulp, options.e2ePaths, onError, { platform: 'Windows 7', browserName: 'chrome', version: '37.0' }); }); gulp.task('integration:windows:firefox', function() { return GrommetTestUtils.runIntegration(gulp, options.e2ePaths, onError, { platform: 'Windows 7', browserName: 'firefox', version: '32.0' }); }); gulp.task('integration:windows', ['start:docs', 'selenium'], function(done) { return runSequence('integration:windows:ie', 'integration:windows:chrome', 'integration:windows:firefox', 'integration:clean', 'stop:docs', done); }); /** ** Linux e2e matrix **/ gulp.task('integration:linux:firefox', function() { return GrommetTestUtils.runIntegration(gulp, options.e2ePaths, onError, { platform: 'Linux', browserName: 'firefox', version: '32.0' }); }); gulp.task('integration:linux:opera', function() { return GrommetTestUtils.runIntegration(gulp, options.e2ePaths, onError, { platform: 'Linux', browserName: 'opera', version: '12.15' }); }); gulp.task('integration:linux:chrome', function() { return GrommetTestUtils.runIntegration(gulp, options.e2ePaths, onError, { platform: 'Linux', browserName: 'chrome', version: '37.0' }); }); gulp.task('integration:linux', ['start:docs', 'selenium'], function(done) { return runSequence('integration:linux:firefox', 'integration:linux:opera', 'integration:linux:chrome', 'integration:clean', 'stop:docs', done); }); /** ** OSX e2e matrix **/ gulp.task('integration:osx:firefox', function() { return GrommetTestUtils.runIntegration(gulp, options.e2ePaths, onError, { platform: 'OS X 10.10', browserName: 'firefox', version: '32.0' }); }); gulp.task('integration:osx:safari', function() { return GrommetTestUtils.runIntegration(gulp, options.e2ePaths, onError, { platform: 'OS X 10.10', browserName: 'safari', version: '8.0' }); }); gulp.task('integration:osx:chrome', function() { return GrommetTestUtils.runIntegration(gulp, options.e2ePaths, onError, { platform: 'OS X 10.10', browserName: 'chrome', version: '37.0' }); }); gulp.task('integration:osx', ['start:docs', 'selenium'], function(done) { return runSequence('integration:osx:firefox', 'integration:osx:safari', 'integration:osx:chrome', 'integration:clean', 'stop:docs', done); }); gulp.task('integration:phantomjs', function() { return GrommetTestUtils.runIntegration(gulp, options.e2ePaths, onError); }); gulp.task('integration:localhost', ['start:docs', 'selenium'], function(done) { return runSequence('integration:phantomjs', 'integration:clean', 'stop:docs', done); }); };
const basename = require('path').basename const readFile = require('fs').readFileSync const through = require('through2') const run = require('run-sequence') const jade = require('jade').compile const moment = require('moment') const gulp = require('gulp-help')(require('gulp')) const del = require('del') const gutil = require('gulp-util') const markdown = require('gulp-markdown') const prettify = require('gulp-html-prettify') const livereload = require('gulp-livereload') const gls = require('gulp-live-server') const deploy = require('gulp-gh-pages') const server = gls([gls.script, 'dist', 9080], undefined, false) gulp.task('clean', false, (done) => { return del(['./dist'], done) }) gulp.task('compile', false, (done) => { return gulp.src('./src/**/*.md') .pipe(through.obj((file, encoding, cb) => { const contents = file.contents.toString() file.title = /\#\s?(.+)/ig.exec(contents).pop() file.lastModified = moment(file.stat.mtime).format('dddd, MMMM D, YYYY h:mm A [GMT]ZZ') return cb(null, file) })) .pipe(markdown()) .pipe(through.obj((file, encoding, cb) => {
var gls = require('gulp-live-server'); gls('dist/server.js', undefined, false).start(); gls('dist/worker.js', undefined, false).start();
gulp.task("live-server", function(){ if(!server){ server = liveServer("server/index.js"); } server.start(); })
gulp.task('live-server', function(){ var server = gls('./server/main.js'); server.start(); });
gulp.task('server', function() { var server = gls('./server/index.js') });