0

NPM Script Explorer is convenient for running npm script in a mouse click without navigating to the specific folder and typing the command.

Is there any way can binding specific script such as build with keyboard (ctrl+R or setup the hotkey) ?

NPM Script Explorer

Jimmy
  • 3
  • 1

1 Answers1

1

If you search in the keyboard shortcuts for "npm-script" you will see one command for running the npm script test already bound to Ctrl-R T.

There is a command for a "build" script, but it isn't bound to anything yet:

npm-script.build

You could select that one in the keyboard shortcuts page and set a keybinding to it.

Also see my answer at shortcut for an npm script. For example:

 {
    "key": "ctrl+alt+u",
    "command": "workbench.action.terminal.sendSequence",
    "args": {
      "text": "npm run-script someScriptNameHere\u000D"
    }
 }

Just replace someScriptName with whatever script you want to run, and choose your own keybinding.

Mark
  • 143,421
  • 24
  • 428
  • 436
  • It seems an alternative way to do the shortcut without NPM Script Explorer, this method also solved my problem. thanks !! – Jimmy Nov 12 '18 at 07:55