Giter Club home page Giter Club logo

Comments (5)

Artak-Mkrtchyan avatar Artak-Mkrtchyan commented on June 15, 2024 2

Thank you

from rush-monorepo-boilerplate.

abereghici avatar abereghici commented on June 15, 2024 1

@Artak-Mkrtchyan I would suggest to use command-line.json to create your commands, the benefit of it is you can run the commands from different folders in your monorepo, so you don't need to run the command from the root.

If you want to start multiple projects, you can use a bulk command. Something like this:

    {
      "name": "start",
      "commandKind": "bulk",
      "summary": "Starts all projects in the repo",
      "description": "Iterates through each project in the repo and runs the 'start' script",
      "enableParallelism": true,
      "safeForSimultaneousRushProcesses": true,
      "ignoreMissingScript": true,
      "ignoreDependencyOrder": true
    },

This command will go through all your packages and will execute the start script. This thing will be done in parallel and will skip the package if there is no start command. (Also you can target only the desired packages with rush start --only @monorepo/react-app --only @monorepo/react-second-app). This might work in multiple cases, but if you're working with react ,you would want to see the errors output from your webpack-dev-server. In this case you can create a command for each project to start it ( also in command-line.json.

{
      "name": "start:react-app",
      "commandKind": "global",
      "summary": "Start the react-app project",
      "safeForSimultaneousRushProcesses": true,
      "shellCommand": "cd apps/react-app && rushx start"
    },
    {
      "name": "start:react-second-app",
      "commandKind": "global",
      "summary": "Start the react-second-app project",
      "safeForSimultaneousRushProcesses": true,
      "shellCommand": "cd apps/react-second-app && rushx start"
    }

So from anywhere in your monorepo you can run rush start:react-app in a terminal and you'll have the output from webpack. Same for the second app : start:react-second-app.

I hope that helps you.

from rush-monorepo-boilerplate.

abereghici avatar abereghici commented on June 15, 2024 1

@Artak-Mkrtchyan I have created a branch with those commands, so you can play around to see if that solves your issue.
https://github.com/abereghici/rush-monorepo-boilerplate/tree/start_multiple_projects

from rush-monorepo-boilerplate.

Artak-Mkrtchyan avatar Artak-Mkrtchyan commented on June 15, 2024

Should I create a script or I should use common/config/rush/command-line.json ?

from rush-monorepo-boilerplate.

Artak-Mkrtchyan avatar Artak-Mkrtchyan commented on June 15, 2024

because if I use the global command and try to run project 1 and project 2
Screenshot 2021-12-20 at 23 13 19

from rush-monorepo-boilerplate.

Related Issues (1)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.