1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Anuncie Aqui
    Anuncie aqui você Também: fdantas@4each.com.br

Can Nx or Angular Schematics support global path aliases in project.json for all keys...

Discussão em 'Angular' iniciado por Webia1, Setembro 16, 2024.

  1. Webia1

    Webia1 Guest

    In our current workflow, in Nx Monorepo, we are developing VSCode extensions that automate the creation and configuration of new (e.g. Angular) apps based on templates located in various subdirectories.

    Currently, several keys in the project.json file, such as $schema, require relative paths:

    "$schema": "../../../node_modules/nx/schemas/project-schema.json"


    While this works, it becomes a maintenance issue when directory structures change. Teams are then required to manually update these paths, which can lead to errors and necessitate frequent updates to our VSCode extensions.

    To avoid such issues, we are wondering if it is possible to use a global path alias (e.g., @workspace) for all keys that currently require a relative path. This would make the configuration more resilient to directory changes and reduce maintenance efforts. For example:

    "$schema": "@workspace/node_modules/nx/schemas/project-schema.json"


    Is this currently possible with Nx or Angular Schematics, or is there a workaround we could use?

    EDIT: For the case this is not currently possible, where would be the best place to raise an issue for this feature? Should it be with Nx, Angular, or both?

    Continue reading...

Compartilhe esta Página