-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3bdfdee
commit 89ba5da
Showing
1 changed file
with
20 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,23 @@ | ||
import { defineConfig } from 'tsup'; | ||
/* eslint-disable no-param-reassign */ | ||
import { Options, defineConfig } from 'tsup'; | ||
|
||
export default defineConfig({ | ||
entry: ['src/index.ts'], | ||
treeshake: true, | ||
sourcemap: 'inline', | ||
const commonConfig: Options = { | ||
minify: true, | ||
clean: true, | ||
dts: true, | ||
splitting: false, | ||
format: ['cjs', 'esm'], | ||
external: ['react'], | ||
injectStyle: false, | ||
}); | ||
format: ['esm', 'cjs'], | ||
sourcemap: true, | ||
clean: true, | ||
}; | ||
export default defineConfig([ | ||
{ | ||
...commonConfig, | ||
esbuildOptions: (options) => { | ||
// Append "use client" to the top of the react entry point | ||
options.banner = { | ||
js: '"use client";', | ||
}; | ||
}, | ||
entry: ['src/index.ts'], | ||
outDir: 'dist', | ||
}, | ||
]); |