1. Anuncie Aqui ! Entre em contato fdantas@4each.com.br

How to Change dist Directory Structure After NX Build for Angular Publishable Libraries

Discussão em 'Angular' iniciado por SKL, Outubro 9, 2024 às 12:12.

  1. SKL

    SKL Guest

    I'm working on an NX Angular application with multiple publishable libraries. Currently, after running nx build, the dist directory has the following structure:

    current:

    dist
    └── libs
    └── ui-kit
    └── components
    └── button


    desired:

    dist
    └── ui-kit
    └── button


    *project.json:

    ...
    "projectType": "library",
    "targets": {
    "build": {
    "executor": "@nx/angular:package",
    "outputs": [
    "{workspaceRoot}/dist/{projectRoot}"
    ],
    "options": {
    "project": "libs/ui-kit/ng-package.json"
    },
    "configurations": {
    "production": {
    "tsConfig": "libs/ui-kit/tsconfig.lib.prod.json"
    },
    "development": {
    "tsConfig": "libs/ui-kit/tsconfig.lib.json"
    }
    },
    "defaultConfiguration": "production"
    },
    ...


    image:

    [​IMG]

    Is there a way to change the default output directory structure after building the libraries? Specifically, I want to avoid the additional libs and components layers in the dist folder.

    I've checked the angular.json and workspace.json files but haven't found a clear way to adjust the path in the build process.

    Any advice or guidance on how to achieve this would be greatly appreciated. Thanks!

    Continue reading...

Compartilhe esta Página