Created
November 13, 2016 19:51
-
-
Save Zerg00s/1f9ec4b33c2bfcc9dda15a5097fa05ae to your computer and use it in GitHub Desktop.
default gulp task with prompt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | |
})); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"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