gulp-aspnet5

1.0.2 • Public • Published

ASPNET5 Gulp Plugin

GulpJS plugin for ASPNET5 / DNX / DNU / Kestrel that is cross-platform. This plugin does the following:

  • Build
  • Update
  • Start DNX

and with Gulp you can setup watchers for recompiling on the fly and restarting the web server. Similar to gulp-dnx but this one has more logging opts, notifications and is cross platform.

Usage

build.js

var gulp = require('gulp');
var DNX = require('gulp-aspnet5');
gulp.task('build:csharp', function(cb) {
  DNX.build({ cwd: './' }, cb);
});

watch.js

var gulp = require('gulp');
var runSequence = require('run-sequence');
var paths = './**/*.cs';

function changed(event) {
  gutil.log(`File ${event.path} was ${event.type}, running tasks...`);
};

gulp.task('watch', ['build'], function() {
  gulp.watch(paths, {interval: 500}, function(){
    runSequence('build:csharp', 'start:api');
  }).on('change', changed);
});

server.js

var gulp = require('gulp');
var DNX = require('gulp-aspnet5');

var server;
gulp.task('start:api', function(cb) {
  if(!server) server = new DNX({ cwd: paths.api  });
  server.start('weblistener', cb);
});

Options

{
  // current working directory
  cwd: './',
  
  // how noisy?
  // options: 'debug', 'info', 'error', 'silent'
  logLevel: 'debug',
  
  // notify on errors
  notify: true
}

Credits

gulp-aspnet5 is a Swimlane open-source project; we believe in giving back to the open-source community by sharing some of the projects we build for our application. Swimlane is an automated cyber security operations and incident response platform that enables cyber security teams to leverage threat intelligence, speed up incident response and automate security operations.

License

MIT

Package Sidebar

Install

npm i gulp-aspnet5

Weekly Downloads

1

Version

1.0.2

License

ISC

Last publish

Collaborators

  • amcdnl