How to run gulp task in visual studio code? - gulp

I have opened my work-space in Visual Studio Code and I have setup gulp tasks. Now I am running gulp tasks in CMD windows. Have do I run gulp tasks directly from VS Code?
Say I have gulp tasks for
Test
Serve
Build

Normally VS code auto detect gulp task.
As you can see in this doc
Pressing F1 and then typing Run Task followed by Enter will list all
available tasks. Selecting one and pressing Enter will execute the
task.
hope this helps

Related

How do I fix gulpfile.js to avoid "Did you forget to signal async completion?" when running "gulp ngrok-serve" and DO NOT have the task defined?

I used 2 tutorial clips from Microsoft (first, second) to build a sample Teams Message Extension.
I'm down to the final step of really starting the app with the gulp ngrok-serve command, but I get this error message:
...
[16:05:29] Watching .env
[16:05:29] The following tasks did not complete: ngrok-serve, serve, watch
[16:05:29] Did you forget to signal async completion?
I've read various suggestions on how to fix this, but the problem in my case is that I don't have the "ngrok-serve" task defined in my file. It seems to be running a "default" version of it.
So how should I define/overwrite it, so that I can fix it's implementation, in my gulpfile.js file ?
Thank you.
We were able to run the app successfully using gulp serve, as mentioned in the Build your first Microsoft Teams app using the Yeoman generator documentation. Please run the app using gulp serve.

Autorun gulp tasks in Visual Studio Code when opening workspace

Every time I open my project's workspace in Visual Studio Code, I have to manually press F1, write 'run task' and select my startup task to rebuild source code and initiate the debug web server/source-file watchers.
Is there a way to have Visual Studio Code auto-run this task for me when I open a workspace?
Like a 'default' task (seemed to work with Task Runner in Visual Studio 201x). Maybe there is some other naming-convention in Visual Studio Code that I'm not aware of (I've Googled a lot).
There is a plugin called Blade Runner which does this. Only problem you need to stick to the default run build task. You can run different tasks inside the default one.

Visual Studio Code tasks & debugging

I use a gulp task to run my node.js unit tests, and a VSCode task to execute this gulp task. Now I'd like to debug my tests. Unfortunately, VSCode ignores break points when running the task. Apparently it uses the default run mode instead of the debug mode when starting a task.
Is there a way to tell VSCode to execute a task in debug mode?
Here is an example for mocha tests: https://gist.github.com/paambaati/54d33e409b4f7cf059cc#gistcomment-1835655
In other cases you have to create a launch.json to debug you code. In this configuration you can set the preLaunchTask property to the name of your gulp task. If your task is configured as isWatching you might also need to configure a problemMatcher otherwise the task will not allow the debugger to start before the task ends.

gulp is not creating destination folder for compiled file in eclipse IDE

I'm importing gulp task runner for my local projects. My problem is gulp is not creating destination folder for all the compiled files in eclipse IDE and I'm also refreshing my projects but not visible anything.
However, when I'm running those task in cmd then its showing running all tasks. Please help me to understand this.
>gulp.task('scripts', function(){
gulp.src('javascript/src/*.js')
.pipe(uglify()).
pipe(gulp.dest('javascript/build/js'));
});

Why won't my NAnt builds run in Hudson?

My NAnt builds run fine locally on a developer machine, and locally on the command line of the Hudson server, but they will not run in my configured Hudson project.
The console output when I run a Build via the Hudson web UI is similar to the following :
Started by user anonymous [workspace]
$ sh -xe
C:\WINDOWS\TEMP\hudson8104357939096562606.sh
C:\WINDOWS\TEMP\hudson8104357939096562606.sh:
fork failed: no error [1] Archiving
artifacts Finished: SUCCESS
I have another project configured properly that runs fine so I know the NAnt plugin is setup properly in Hudson, and that NAnt is on the system path.
Can anyone suggest possible causes as to why this build won't run?
The problematic build may be configured to Execute a Shell script, rather than Execute a Windows Batch file.
Copy the command from the existing build step (the Execute Shell Script) and remove the step. Then add a new step to Execute a windows Batch File and paste the command.
Trigger the build and observe the results.
(I asked and answered this since it took me quite a while to figure out how I had mis-configured this particular build. Hopefully it'll save time or give ideas to other people trouble-shooting automation..)