Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Gulpfile is not being recognized

The documentation states that gulp and jake files should be autodetected. I have a gulpfile.js in the root of my opened folder, but it is not being autodetected and listed in the task list when I try and run a task. Am I missing something?

like image 522
Kmart2k1 Avatar asked May 01 '15 18:05

Kmart2k1


2 Answers

  1. gulpfile.js in the root

  2. npm install -g gulp :gulp install globally

  3. npm install gulp : gulp install locally to your dev folder

  4. You need a custom tasks.json file:

    {
        "version": "0.1.0",
        "command": "gulp",
        "isShellCommand": true,
        "args": [
            "--no-color"
        ],
        "tasks": []
    }
    
like image 87
Alphapage Avatar answered Oct 05 '22 01:10

Alphapage


Visual Studio Code with ( tasks.json - version 2.0.0 ). Included gulp task runner. "Ctrl + Shift + B" -> execute tasks in gulpfile.js -> open html file with Chrome browser.

{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
    {
        "taskName": "Gulp",
        "type": "shell",
        "command": "gulp",
        "group": {
            "kind": "build",
            "isDefault": true
        },
        "presentation": {
            "reveal": "always"
        }
    },
    {
        "taskName": "Chrome",
        "type": "process",
        "command": "chrome.exe",
        "windows": {
            "command": "C:\\Program Files(x86)\\Google\\Chrome\\Application\\chrome.exe"
        },
        "args": [
            "${file}"
        ]
    }
]
}
like image 37
Ted Avatar answered Oct 05 '22 01:10

Ted