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

Configuration pure doesn't seem to work #1254

Open
Virtute90 opened this issue Nov 26, 2024 · 0 comments
Open

Configuration pure doesn't seem to work #1254

Virtute90 opened this issue Nov 26, 2024 · 0 comments

Comments

@Virtute90
Copy link

Virtute90 commented Nov 26, 2024

When I use the pure option, it doesn't seem to have any effect:

import { defineConfig } from 'tsup';

export default defineConfig({
  entry: ['src/**/*.@(ts|tsx)'],
  format: ['cjs', 'esm'],
  target: 'esnext',
  treeshake: true,
  pure: 'useContext',
  dts: false,
  splitting: false,
  sourcemap: true,
  clean: true,
  minify: true
});

when i build the project with treeshake active i get these warnings

"useContext" is imported from external module "react" but never used in "dist/Header/Header.js". Generated an empty chunk: "types".

Same effect if I use CLI

npx tsup --pure useContext

Am I doing something wrong?

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
@Virtute90 Virtute90 changed the title Configuration also doesn't seem to work Configuration pure doesn't seem to work Nov 26, 2024
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

1 participant