Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

204
Visualizações
Parcel does not generate type declarations for a TypeScript library

I just started using Parcel and I have this issue, where it is not generating type declarations and emits an empty index.d.ts file instead. Here is my configuration in package.json:

{
  // ...
  "scripts": {
    "prepare": "yarn build",
    "check": "tsc --noEmit",
    "watch": "parcel watch --no-source-maps --no-cache",
    "build": "parcel build --no-source-maps --no-cache"
  },
  "main": "./lib/index.js",
  "source": "./src/index.ts",
  "types": "./lib/index.d.ts",
  "module": "./lib/esm/index.js",
  "devDependencies": {
    "@parcel/packager-ts": "^2.0.1",
    "@parcel/transformer-typescript-types": "^2.0.1",
    "@types/node": "^16.11.9",
    "parcel": "^2.0.1",
    "typescript": "^4.5.2"
  },
  // ...
}

And here is a simple example of an type that I have defined in my code:

export type Response = {
  /**
   * The list of added/removed hashes
   */
  hashes: string[];
  /**
   * The list of skipped hashes
   */
  skipped: string[];
};

Any ideas why this is happening? Have I configured something incorrectly? I have followed this documentation.

Thank you.

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

It looks like your issue is caused by the the "incremental": true line in your tsconfig.json's "compilerOptions" (see here). If you remove this line, parcel should generate .d.ts files as expected.

(In an ideal world, parcel should be able to handle this case - I filed this bug with parcel to report the problem - and this PR to fix it).

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda