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

Support banner and footer esbuild options? #451

Closed
iCrawl opened this issue Nov 3, 2021 · 5 comments
Closed

Support banner and footer esbuild options? #451

iCrawl opened this issue Nov 3, 2021 · 5 comments
Labels

Comments

@iCrawl
Copy link

iCrawl commented Nov 3, 2021

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: evanw/esbuild#946 (comment)

@egoist
Copy link
Owner

egoist commented Nov 3, 2021

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]
}

@egoist egoist closed this as completed in 1fa05c3 Nov 3, 2021
@github-actions
Copy link
Contributor

github-actions bot commented Nov 3, 2021

🎉 This issue has been resolved in version 5.6.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@egoist
Copy link
Owner

egoist commented Nov 3, 2021

Now you can directly use footer and banner options in tsup.config.ts

@loynoir
Copy link

loynoir commented Mar 20, 2022

Just a notice for new searchers come in.

A bit different from esbuild.

#505

topLevelCreateRequire(import\.meta.url)

result in

topLevelCreateRequire(import.meta.url)

evanw/esbuild#946 (comment)

topLevelCreateRequire(import.meta.url)

result in

topLevelCreateRequire("file:///path/to/tsup.config.ts")

@loynoir
Copy link

loynoir commented Mar 20, 2022

@egoist
I think instead of

topLevelCreateRequire("file:///path/to/tsup.config.ts")

should be rewritten to

topLevelCreateRequire("file:///path/to/package.json")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants