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?
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too