Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Issue] Generate all .d.ts files in place instead of generate them in dist #5

Closed
5 tasks done
gtrabanco opened this issue Aug 6, 2023 · 3 comments
Closed
5 tasks done

Comments

@gtrabanco
Copy link

gtrabanco commented Aug 6, 2023

Describe the bug

After applying #4 (comment) This patch to solve the issues with the package all .d.ts files are created in the path where the files are.

Captura de Pantalla 2023-08-06 a las 14 31 02

Instead of creating all those .d.ts files in the outDir:

Captura de Pantalla 2023-08-06 a las 14 32 06

Not sure if this is the expected behaviour.

Reproduction

#!/usr/bin/env bun --bun
import dts from 'bun-plugin-dts-auto';

await Bun.build({
  entrypoints: [
    './src/index.ts',
  ],
  target: 'node',
  sourcemap: "external",
  minify: true,
  root: './src',
  outdir: './dist',
  plugins: [
    dts({
      withSourceMap: true, // optional
    }),
  ],
});

console.log('Build complete ✅');

System Info

System:
    OS: macOS 12.6.7
    CPU: (8) x64 Intel(R) Core(TM) i7-4770HQ CPU @ 2.20GHz
    Memory: 42.22 MB / 16.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 20.4.0 - ~/Library/Caches/fnm_multishells/45496_1690908490075/bin/node
    npm: 9.7.2 - ~/Library/Caches/fnm_multishells/45496_1690908490075/bin/npm
    pnpm: 8.6.6 - ~/.bun/bin/pnpm
  Browsers:
    Brave Browser: 115.1.56.14
    Safari: 16.5.2


Bun: 0.7.3 (today's latest canary).

Used Package Manager

pnpm

Validations

  • Follow our Code of Conduct
  • Read the Contributing Guide.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • Check that this is a concrete bug. For Q&A, please open a GitHub Discussion instead.
  • The provided reproduction is a minimal reproducible of the bug.
@mfeckie
Copy link

mfeckie commented Aug 6, 2023

I fixed this by updating the tsconfig.json to tell it the correct output location for the .d.ts files

{
  "compilerOptions": {
   //
    "outDir": "./dist",
}

@gtrabanco
Copy link
Author

gtrabanco commented Aug 6, 2023

I fixed this by updating the tsconfig.json to tell it the correct output location for the .d.ts files

{
  "compilerOptions": {
   //
    "outDir": "./dist",
}

Yes, it works great. Was this a missconfiguration option error from me? Just to know if I have to close this issue.

When I configured Bun.build I supposed it will be using the build outDir option instead of tsconfig.

@chrisbbreuer
Copy link
Member

chrisbbreuer commented Feb 23, 2024

Thanks for creating this issue!

My apologies on the late resolution here, but we are now finally able to support this more actively now. Stacks had been consuming all of my free time, but this plugin is now finally a first-class citizen (which means great ongoing support 😃)

This is resolved in v0.4.0 by treating the tsconfig.json as a default which can be overriden by the outDir option. Also left a note in the readme.

Let me know if there is anything else I can help with!

Cheers ✌️

v0.3.0...v0.4.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants