2017-08-23 7 views
0

今はVisual Studioコードでtasks.json 0.1.0バージョンのタスクを使用しています。tasks.jsonバージョン2でgulpビルドを設定するにはどうすればよいですか?

https://code.visualstudio.com/docs/editor/tasksに移動すると、VSコードが自動的にgulpファイル内のすべてのタスクを検出することを示します。

タスクを自動検出するためにさまざまな拡張機能をインストールしましたが、まだ検出されていません。

ここでは、すべてのGulpタスクを処理する新しいバージョンのtasks.jsonを作成します。

どうすればよいですか?

{ 
// See https://go.microsoft.com/fwlink/?LinkId=733558 
// for the documentation about the tasks.json format 
"version": "0.1.0", 
"command": "gulp", 
"isShellCommand": true, 
"args": [], 
"showOutput": "always", 
"options": { 
    "cwd": "${workspaceRoot}/MyAppName" 
}, 
"tasks": [ 
    { 
     "taskName": "build", 
     "args": ["build:debug"] 
    }, 
    { 
     "taskName": "build:debug", 
     "args": ["build:debug"] 
    }, 
    { 
     "taskName": "build:release", 
     "args": ["build:release"] 
    } 
] 
} 

私は他の質問を見てきたし、tasks.json 2.0で実行してゴクゴクを取得する方法を示し、現時点では何があるようには思えない。ここに私のtasks.json 0.1.0です。

gulpfileを含むフォルダの外からこのビルドタスクを使用できます。私はVSが自動的に私のgulpfileが開かれているフォルダのタスクを検出することを知っている。

答えて

0

ウェブを精練した後、何も見つかりませんでした。ビルドのコードでカスタムビルドをセットアップしたかったのです:debug gulp task。

だから、私は自分自身を構築しました:

(buildDebug.sh)

#!/bin/bash 
clear 
pwd 
cd [your gulpfile.js directory] 
gulp build:debug 

(tasks.json)

{ 
    // See https://go.microsoft.com/fwlink/?LinkId=733558 
    // for the documentation about the tasks.json format 
    "version": "2.0.0", 
    "tasks": [ 
     { 
      "taskName": "Run Build", 
      "type": "shell", 
      "command": "/c/[where you saved buildDebug.sh]/buildDebug.sh", 
      "group": { 
       "kind": "build", 
       "isDefault": true 
      }, 
      "presentation": { 
       "reveal": "always", 
       "panel": "shared" 
      } 
     } 
    ] 
} 
関連する問題