gulp-aspnet-k
Gulp plugin for ASP.NET 5. You can use this plugin to integrate ASP.NET 5 dnu build
, dnu restore
and dnx
command execution (for the commands available inside you project.json file). Check out the example inside the repository.
Installation
You can install gulp-aspnet-k plugin through npm:
npm install gulp-aspnet-k
Preferably, you can save this as dev dependency:
npm install gulp-aspnet-k --save-dev
Usage
var gulp = aspnetk = ;gulp;gulp;
The default function restores the packages according to your project.json file and runs the web command inside the project.json file. You can pass a few options to this to choose what's actually going to run:
// the default optionsvar options = restore: true build: false run: true kCommand: 'web' cwd: './';gulp;
There are also shorthand methods for specific tasks:
gulp;// only restores the packagesgulp;// only builds the projectgulp;// restores the packages and builds the projectgulp;
gulp-aspnet-k also integrates with k --watch
to run your commands. So, it will restart your server when you change a code file.
cwd
You can change the working directory for the specific command to run passing cwd
as an option to the main method or as parameter to the shorthand methods.
//assuming project.json is inside the 'server' directoryvar options = kCommand: 'web' cwd: './server/';gulp; //using the shorthand methodsgulp;gulp;gulp;