If you choose the Project alias, WebStorm will automatically use the project default interpreter from the Node interpreter field on the Node.js page. Specify the name of the run configuration, the tasks to run (use blank spaces as separators), the location of the Gruntfile.js file where these tasks are defined, and the path to the globally installed grunt-cli package. The Run/Debug Configuration: Grunt.js dialog opens. ![]() In the Edit Configurations dialog that opens, click the Add button ( ) on the toolbar and select Grunt.js from the list. Alternatively, select Edit Configurations from the list on the toolbar. Create a Grunt.js run/debug configuration Running and debugging tasks according to a run configurationīesides using temporary run configurations that WebStorm creates automatically when you run tasks or targets from tasks tress, you can create and launch your own Grunt.js run configurations. Select the required task or target in the tree, and choose Jump to source from the context menu of the selection. Jump to the definition of a task or a target Use the multiselect mode: hold Shift (for adjacent items) or Control (for non-adjacent items) keys and select the required tasks or targets, then choose Run or Debug from the context menu of the selection. Select the root node in the tree, and choose Run default from the context menuu of the selection. To use these options, run tasks or targets from a run configuration as described in Running and debugging tasks according to a run configuration below. As a result, you cannot configure WebStorm, for example, to ignore warnings or provide a detailed log. Note that when you run tasks from a tasks tree, the force execution and verbose mode options are not available. Select the task or target in the tree and press Enter or choose Run from the context menu. Switch to the required node and click on the toolbar.Ĭlick on the toolbar, choose Sort by from the menu, and then choose Name.īy default, a tree shows the tasks in the order in which they are defined in Gruntfile.js (option Definition order). WebStorm adds a new node with the path to the chosen Gruntfile.js file on its title and builds a tasks tree under the new node. If you have another Gruntfile.js file, click Choose Gruntfile.js and select the Gruntfile.js file you need in the dialog that opens. By default, WebStorm shows the Gruntfile.js file in the root of your project. ![]() In the Grunt tool window, click on the toolbar and choose the required Gruntfile.js file from the list. Select the required Gruntfile.js file in the Project tool window or open it in the editor and choose Show Grunt Tasks from the context menu.īuild a tree of tasks from the Grunt tool window When you build a tree of tasks for the first time during a WebStorm session, the Grunt tool window is not opened yet. ![]() WebStorm automatically creates a temporary run configuration which you can save and use later, if necessary. WebStorm lets you run Grunt tasks easily and fast right from the tasks tree in the Grunt tool window. In the embedded Terminal ( Alt+F12), type: Learn more about Gruntfile.js from the Grunt official website. To use Grunt in a WebStorm project, you need two packages:Ī globally installed grunt-cli package (Grunt command-line interface) for executing Grunt commands.Ī grunt package installed as development dependency to build the project tasks tree and provide coding assistance while editing the Gruntfile.js or ffee file. Make sure you have Node.js on your computer. ![]() The name of the last executed task is displayed on the title bar of the tool window. The tool window shows the Grunt output, reports the errors occurred, lists the packages or plugins that have not been found, etc. WebStorm shows the result of executing a task in the Run tool window. With WebStorm, you can run Grunt tasks from tasks trees in the dedicated Grunt tool window, or using a Grunt run configuration, or as a before-launch task. WebStorm parses Gruntfile.js files, recognizing definitions of tasks and targets, shows tasks and targets in a tree view, lets you navigate between a task or a target in the tree and its definition in the Gruntfile.js file, and supports running and debugging tasks and targets. WebStorm integrates with the Grunt JavaScript Task Runner.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |