I'm working with Brackets and Gulp prior to CTP7 hitting. I have a command setup to use WebListener:
"commands": {
"test": "Microsoft.AspNet.Hosting --server Microsoft.AspNet.Server.WebListener --server.urls http://localhost:5001"
},
I would like to have my gulpfile.js run whenever I execute my test command. Because I'm using Brackets right now, I can't use VS's nice build events feature to run Gulp automatically.
I am aware of the existence of gulp.task('watch', function () { ... }, but I would prefer not to have to type gulp even once before executing dnx . test. I want Gulp to run automatically once each time I issue my dnx . test command.
I tried hooking it by way of the scripts of project.json by simply replacing the echo xxx line with the command gulp:
"scripts": {
"prepack": "echo before packing",
"postpack": "echo after packing",
"prepublish": "echo before publishing",
"postpublish": "echo after publishing",
"prerestore": "echo before restoring packages",
"postrestore": "echo after restoring packages",
"prepare": "echo prepare"
},
... but nothing will trigger Gulp prior to firing up WebListener. prerestore and postrestore will run Gulp when I use dnu restore, but I may as well be typing gulp at the command line once (using a gulp watch task) before running dnx . test rather than using dnu restore every time, since I usually do not need to restore packages to test run my app.
Can it be done?
If not, I'd like to float a feature request for one more scripts option for something like precommand, which could be a command line statement to be run when any dnx . {command} is issued? This could have a variety of uses well beyond just a simple Gulp call. It would be even better if you could attach command line commands to any of your dnx commands (e.g., "precommand": [{"test": "gulp"}, {"another dnx command": "another command line command"}]).
I'm working with Brackets and Gulp prior to CTP7 hitting. I have a command setup to use WebListener:
I would like to have my
gulpfile.jsrun whenever I execute mytestcommand. Because I'm using Brackets right now, I can't use VS's nice build events feature to run Gulp automatically.I am aware of the existence of
gulp.task('watch', function () { ... }, but I would prefer not to have to typegulpeven once before executingdnx . test. I want Gulp to run automatically once each time I issue mydnx . testcommand.I tried hooking it by way of the
scriptsofproject.jsonby simply replacing theecho xxxline with the commandgulp:... but nothing will trigger Gulp prior to firing up WebListener.
prerestoreandpostrestorewill run Gulp when I usednu restore, but I may as well be typinggulpat the command line once (using a gulp watch task) before runningdnx . testrather than usingdnu restoreevery time, since I usually do not need to restore packages to test run my app.Can it be done?
If not, I'd like to float a feature request for one more
scriptsoption for something likeprecommand, which could be a command line statement to be run when anydnx . {command}is issued? This could have a variety of uses well beyond just a simple Gulp call. It would be even better if you could attach command line commands to any of your dnx commands (e.g.,"precommand": [{"test": "gulp"}, {"another dnx command": "another command line command"}]).