Skip to content

Instantly share code, notes, and snippets.

@Zerg00s Zerg00s/gulpfile.js
Created Nov 13, 2016

Embed
What would you like to do?
default gulp task with prompt
var prompt = require("gulp-prompt");
// Promts you to choose a task
gulp.task('default', function() {
var taskNames = [];
for (var taskName in gulp.tasks) {
if (gulp.tasks.hasOwnProperty(taskName)) {
taskNames.push(taskName);
}
}
return gulp.src('*').pipe(
prompt.prompt({
type: 'list',
name: 'task',
message: 'Choose task name',
choices: taskNames
}, function(userResponse){
gulp.tasks[userResponse.task].fn();
}));
});
{
"version": "0.2.0",
"configurations": [
{
"name": "Launch",
"type": "node",
"request": "launch",
"program": "${workspaceRoot}/node_modules/gulp/bin/gulp.js", // we will run gulp.js when hitting F5
"stopOnEntry": false,
"args": [], // name of the gulp task that will be run when we click F5 in VS Code
"cwd": "${workspaceRoot}",
"preLaunchTask": null,
"runtimeExecutable": null,
"runtimeArgs": [
"--nolazy"
],
"env": {
"NODE_ENV": "development"
},
"console":"integratedTerminal",
"sourceMaps": false,
"outFiles": []
},
{
"name": "Attach",
"type": "node",
"request": "attach",
"port": 5858,
"address": "localhost",
"restart": false,
"sourceMaps": false,
"outFiles": [],
"localRoot": "${workspaceRoot}",
"remoteRoot": null
},
{
"name": "Attach to Process",
"type": "node",
"request": "attach",
"processId": "${command.PickProcess}",
"port": 5858,
"sourceMaps": false,
"outFiles": []
},
{
"name": "publish",
"type": "node",
"request": "launch",
"program": "${workspaceRoot}/node_modules/gulp/bin/gulp.js",
"stopOnEntry": false,
"args": ["publish"],
"cwd": "${workspaceRoot}",
"preLaunchTask": null,
"runtimeExecutable": null,
"runtimeArgs": [
"--nolazy"
],
"env": {
"NODE_ENV": "development"
},
"console":"internalConsole",
"sourceMaps": false,
"outDir": null
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.