Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to launch a specified main file with nest cli #7176

Closed
GO-DIE opened this issue May 24, 2021 · 7 comments
Closed

How to launch a specified main file with nest cli #7176

GO-DIE opened this issue May 24, 2021 · 7 comments
Labels
needs triage This issue has not been looked into type: enhancement 🐺

Comments

@GO-DIE
Copy link

GO-DIE commented May 24, 2021

Feature Request

Is your feature request related to a problem? Please describe.

My project has two main files, one is about APP and the other is about APP admin background system. The specified main file needs to be launched during deployment

Describe the solution you'd like

How to launch a specified main file with nest cli?

@GO-DIE GO-DIE added needs triage This issue has not been looked into type: enhancement 🐺 labels May 24, 2021
@jmcdo29
Copy link
Member

jmcdo29 commented May 24, 2021

You would need two separate nest-cli.json files, one with the standard setup, one with an entryFile option pointing to the admin launch.

For further help, please visit our Discord for Support. We are using GitHub to track Bug Reports, Feature Requests and Regressions.

@jmcdo29 jmcdo29 closed this as completed May 24, 2021
@GO-DIE
Copy link
Author

GO-DIE commented May 24, 2021

You would need two separate nest-cli.json files, one with the standard setup, one with an entryFile option pointing to the admin launch.

For further help, please visit our Discord for Support. We are using GitHub to track Bug Reports, Feature Requests and Regressions.

Thank you.
Where can I find the relevant information in the document.

@jmcdo29
Copy link
Member

jmcdo29 commented May 24, 2021

We're working on the nest-cli.json options documentation. For now, I've just used the source code and read through it

@vfrank66
Copy link

vfrank66 commented Aug 16, 2022

This would be nice to have as a nest start --entryFile option instead of having to create two nest-cli.json options with differing configuration for "entryFile"
Such as
nest-cli.api.json

{
  "collection": "@nestjs/schematics",
  "sourceRoot": "src",
  "entryFile": "main-api"
}

nest-cli.nonapi.json

{
  "collection": "@nestjs/schematics",
  "sourceRoot": "src",
  "entryFile": "non-main"
}

@jmcdo29
Copy link
Member

jmcdo29 commented Aug 16, 2022

You mean like how nest start --help shows that --entryFile is an option that you can pass?

nest start --help
Usage: nest start [options] [app]

Run Nest application.

Options:
  -c, --config [path]        Path to nest-cli configuration file.
  -p, --path [path]          Path to tsconfig file.
  -w, --watch                Run in watch mode (live-reload).
  --watchAssets              Watch non-ts (e.g., .graphql) files mode.
  -d, --debug [hostport]     Run in debug mode (with --inspect flag).
  --webpack                  Use webpack for compilation.
  --webpackPath [path]       Path to webpack configuration.
  --tsc                      Use tsc for compilation.
  --sourceRoot [sourceRoot]  Points at the root of the source code for the single project in
                             standard mode structures, or the default project in monorepo mode
                             structures.
  --entryFile [entryFile]    Path to the entry file where this command will work with.
                             Defaults to the one defined at your Nest's CLI config file.
  -e, --exec [binary]        Binary to run (default: "node").
  --preserveWatchOutput      Use "preserveWatchOutput" option when tsc watch mode.
  -h, --help                 Output usage information.

@micalevisk
Copy link
Member

that feat was added in @nestjs/cli@8.2.7 @vfrank66

@vfrank66
Copy link

Looks like I need to upgrade from v7.x thank you

@nestjs nestjs locked and limited conversation to collaborators Aug 17, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
needs triage This issue has not been looked into type: enhancement 🐺
Projects
None yet
Development

No branches or pull requests

4 participants