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

Why tsconfig.json in agnular does not use proper export in package.json from library?

Discussão em 'Angular' iniciado por ruddnisrus, Outubro 17, 2024 às 19:22.

  1. ruddnisrus

    ruddnisrus Guest

    I got my library - "my-lib" and consumer application "my-app"

    in package.json of my-lib i got exports:

    ".": {
    "types": "./index.d.ts",
    "esm2022": "./esm2022/my-lib.mjs",
    "esm": "./esm2022/my-lib.mjs",
    "default": "./fesm2022/my-lib.mjs"
    }


    In my-app ts.config

    "target": "ES2022",
    "module": "ES2022",
    "useDefineForClassFields": false,
    "lib": [
    "ES2022",
    "dom"
    ]


    When I will remove "default", "esm" I get error

    None of the conditions in the package definition ("types", "esm2022") match any of the currently active conditions ("browser", "default", "es2015", "es2020", "import", "module"):


    Is there any way to configure my-app to use for example only esm / esm2022? Looks like now it uses "default". I want to configure tsconfig in that way, that I will be able to use "esm" export.

    Continue reading...

Compartilhe esta Página