Closed iCrawl closed 2 years ago
You can use a esbuild plugin to modify build options: https://esbuild.github.io/plugins/#build-options
and pass the plugin to tsup.config.ts
:
import type { Options } from 'tsup'
export const tsup: Options = {
esbuildPlugins: [yourPlugin]
}
:tada: This issue has been resolved in version 5.6.0 :tada:
The release is available on:
Your semantic-release bot :package::rocket:
Now you can directly use footer
and banner
options in tsup.config.ts
Just a notice for new searchers come in.
A bit different from esbuild.
https://github.com/egoist/tsup/discussions/505
topLevelCreateRequire(import\.meta.url)
result in
topLevelCreateRequire(import.meta.url)
https://github.com/evanw/esbuild/issues/946#issuecomment-814703190
topLevelCreateRequire(import.meta.url)
result in
topLevelCreateRequire("file:///path/to/tsup.config.ts")
@egoist I think instead of
topLevelCreateRequire("file:///path/to/tsup.config.ts")
should be rewritten to
topLevelCreateRequire("file:///path/to/package.json")
https://esbuild.github.io/api/#banner https://esbuild.github.io/api/#footer
Not sure if there's a nice way to dynamically forward any kind of options esbuild supports so this doesn't have to be updated all the time.
Use case: https://github.com/evanw/esbuild/issues/946#issuecomment-814703190