Skip to content

Expose Options Types and Simplify UserConfig #382

@9romise

Description

@9romise

Clear and concise description of the problem

Currently, it's challenging to create type-safe configuration generators because:

  1. Critical option types aren't exported
  2. Arrayable wrapping forces unnecessary array handling when creating single configs

Suggested solution

  1. Export key option types
export type {} from 'rolldown'
// src/index.ts
export type {
  // region re-export from options, and maybe more
  Format,
  Sourcemap,
  // endregion
  Options,
  ResolvedOptions,
  UserConfig,
  UserConfigFn,
} from './options'

export {
  ExternalOption,
  InputOption,
  InputOptions,
  InternalModuleFormat,
  MinifyOptions,
  ModuleFormat,
  OutputOptions,
} from 'rolldown'
  1. Make UserConfig non-arrayable

Alternative

No response

Additional context

No response

Validations

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions