mckomo / gulp-vapor

Gulp task suite for Vapor web framework.
https://www.npmjs.com/package/gulp-vapor
MIT License
12 stars 1 forks source link

gulp-vapor

Build Status

Gulp task suite for Vapor web framework.

Use gulp-vapor to hot-reaload your Vapor project (see Usage).

Installation

Install gulp-vapor via npm:

$ npm install gulp-vapor

or:

$ npm install --save-dev gulp-vapor

if you already have package.json file.

Usage

Reload project when a source code changes

Modify your gulpfile.js to include following parts:

'use strict';

var gulp = require('gulp');
var vapor = require('gulp-vapor');

gulp.task('vapor:start', vapor.start);
gulp.task('vapor:reload', vapor.reload);

gulp.task('watch', function() {
   gulp.watch('./Sources/**/*', ['vapor:reload']);
});

gulp.task('default', ['vapor:start', 'watch']);

then just run gulp and enjoy automated project recompilation.

$ gulp

By now, you should be able to see you project running in a browser at http://localhost:8080. From now on, If you change something in your App folder, project will reload automatically.

Configuration

If your project requires special configuration during

var vapor = require('gulp-vapor');

vapor.config.commands.build = 'swift build --some-flag';
vapor.config.commands.start = ['.build/debug/gulp-vapor', ['serve', '--port=80']];

Compatiblity