PhpStorm 2017.2 Help

Using Pub

PhpStorm integrates with the pub tool and provides a Pub actions pane for running its actions such as installing dependencies or building the project from the editor.

PhpStorm logs execution of pub commands in the Messages Tool Window where you can also re-run the last executed command by clicking /help/img/idea/2017.2/run.png on the toolbar.

On this page:

Managing Dart dependencies

As soon as you open a pubspec.yaml file in the editor, PhpStorm displays a Pub actions pane at the top of the pubspec.yaml editor tab. Use the links on this pane to invoke pub get, pub upgrade, and pub cache repair actions.

The pub tool saves the downloaded packages in the cache and creates a .packages file and a pubspec.lock file next to the pubspec.yaml file.

Building a Dart application

You can also run the pub build action from the Pub actions pane in the editor.

To build a Dart application:

  1. Open the pubspec.yaml file in the editor or switch to the tab where it is opened.
  2. On the Pub actions pane at the top of the tab, click Build.
  3. In the dialog box that opens, choose the build mode which determines the behaviour of the compiler:
    • Release: choose this option to minify the generated JavaScript code. In the Release mode, the source .dart files are not included in the build output. This mode is applicable when you are going to publish your application.
    • Debug: choose this option if you do not want to compress the generated JavaScript. In this mode, the generated JavaScript files are included in the build output without compression, as well as the source .dart files.
    • Other: choose this option if you want to use a custom build mode.

See Also

Language and Framework-Specific Guidelines:

Last modified: 1 August 2017