Skip to content

Add banner and footer options for output file customization #288

@junwen-k

Description

@junwen-k

Clear and concise description of the problem

Description

It would be useful to have banner and footer configuration options similar to tsup (esbuild) in tsdown to allow inserting custom content (like comments or notices) at the beginning and end of output files.

Use Cases

  1. Adding warning notices about generated files
  2. Including license information
  3. Adding build metadata or timestamps
  4. Inserting environment-specific configuration

Related

Suggested solution

Proposed API

Similar to tsup / esbuild:

export default defineConfig({
  // ... other config
  banner: {
    js: `/**
     * ⚠️  WARNING: This is a generated file
     * Do not edit this file directly.
     * Generated: ${new Date().toISOString()}
     */`,
  },
  footer: {
    js: `// End of generated file`,
  },
})

Alternative

No response

Additional context

No response

Validations

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions