Skip to content

[BUG] Serve target should not be generated for libraries #28

@bcallaghan-et

Description

@bcallaghan-et

Describe the bug
When generating a library, the newly-added section of workspace.json includes a serve target. This target invokes dotnet run under the hood, which is not supported for library projects. The serve target should only be added to application projects.

To Reproduce
Steps to reproduce the behavior:

  1. Create a new Nx workspace
  2. Generate a new class library with npx nx generate @nx-dotnet/core:lib my-lib --template classlib --language C#
  3. Open workspace.json and find the section for my-lib.
  4. The architect key includes a serve target, which will always fail when run.

Expected behavior
A serve target should not be included for library projects. Only the build target should be scaffolded (plus a test target if a test template was specified).

Environment:

  • OS: Windows
  • Browser: N/A
  • Version: 0.2.0
  • Affected Packages: @nx-dotnet/core

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingoutdated

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions