I have a project.json script for 'prepare' that runs a gulpfile to push my bower stuff into the wwwroot. Works great, except during dev I have to manually run it after I update the bower.json package. Any way to automate this during dev? I'd normally use a post-build script but they are no where to be seen. My project.json scripts are looks like this:
"scripts": {
"prepare": [ "gulp bower" ]
}
What i'd love is:
"scripts": {
"post-build": [ "gulp bower" ]
}
You can use the Task Runner Explorer
to automate this. (Use the Quick Launch
in the upper right, Ctrl+Alt+\, or View
->Other Windows
->Task Runner Explorer
.)
Find the task you want to add (bower
or prepare
, depending on the route you want to go), right click, and use the context menu to add the bindings.
My gruntfile.js
, for example, got the following line added to the top:
/// <binding BeforeBuild='beforeBuild' AfterBuild='afterBuildMinimal' ProjectOpened='watch' />
I'm not certain if the gulpfile.js
uses the exact same conventions, but the Task Runner Explorer
is the way to go, either way!
there's postrestore and postbuild you can use on project.json.
I use it like this :
"postrestore": [ "npm install", "bower install" ]
"postbuild": [ "brunch build" ]
in your example, I think you want
"postbuild": [ "gulp bower" ]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With