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

using clean: true with multiple builds leads to missing output files #670

Open
aleclarson opened this issue Jul 15, 2022 · 1 comment
Open

Comments

@aleclarson
Copy link

aleclarson commented Jul 15, 2022

import { defineConfig } from 'tsup'

export default defineConfig([
  {
    entry: ['src/index.ts'],
    format: ['cjs', 'esm'],
    clean: true,
  },
  {
    entry: ['src/index.ssr.ts'],
    format: ['esm'],
    clean: true,
  },
])

When I save either entry point, the output file for the other build is erroneously deleted.

I tried enabling clean: true for the first build only, but it didn't help.

Upvote & Fund

  • We're using Polar.sh so you can upvote and help fund this issue.
  • We receive the funding once the issue is completed & confirmed by you.
  • Thank you in advance for helping prioritize & fund our backlog.
Fund with Polar
@maxpatiiuk
Copy link

I am having a similar issue.
In my case, I need to emit and modify .d.ts files after the build (to workaround #977)
But onSuccess, and esbuilPlugin's onEnd are called before the clean:true option cleans the .d.ts files, which deletes the .d.ts files I create:

cleanDtsFiles(options)

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

2 participants