Instructor: Let's imagine you have a project with a Java back end and Webpack Dev Server. Every time you would like to start the project, you need to run these two NPM scripts in different terminal tabs. Here, we started Webpack Dev Server, and here, we started our back end. Then we need to open website in the browser.
We're going to automate project start with NPM scripts. To solve this, we're going to use Ttab and npm-run-all packages. First, let's create new NPM script that runs command in new tab. Ttab expects command that you want to run in a new tab.
With a navigation terminal, we can add title for each tab. Second, let's create script that opens website in the browser. Third, let's create start script that we're going to use to start the project. To run sequentially all three commands, we are using run-as command.
That comes with the npm-run-all package. Now, let's test it. With one npm start, we are able to run two new tabs. With a back end that has Java server title, our Webpack Dev Server with a build JS title, and website in the browser.