Skip to content

Commit

Permalink
feat: add use client directive
Browse files Browse the repository at this point in the history
  • Loading branch information
rizqitsani committed Jan 11, 2024
1 parent f2f28ce commit 2eed80c
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions packages/ui/tsup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,19 @@ import type { Options } from 'tsup';
const { NODE_ENV } = process.env;

export const tsup: Options = {
splitting: true,
// Set to false to prevent 'use client' directive error in esbuild
splitting: false,
clean: true,
dts: true,
format: ['cjs', 'esm'],
minify: NODE_ENV === 'production',
skipNodeModulesBundle: true,
target: 'es2020',
entry: ['src/index.tsx'],
external: ['react'],
external: ['react', 'react-dom'],
esbuildOptions(options) {
options.banner = {
js: '"use client"',
};
},
};

0 comments on commit 2eed80c

Please sign in to comment.