Skip to content

esbuild config file #952

@ebeloded

Description

@ebeloded

It would be very useful to be able to provide esbuild with a config, instead of having to provide individual arguments, or use the JavaScript API

Here is a sample esbuild.config.ts

export default {
  entryPoints: ['./src/index.ts'],
  bundle: true,
  platform: 'node',
  outfile: 'build/main.js',
  sourcemap: true,
  target: 'node12',
  external: Object.keys(require('../package.json').dependencies),
}

CLI commands

> esbuild --config='esbuild.config.ts'

# any additional arguments would override config values
> esbuild --config='esbuild.config.ts' --watch

Furthermore, the name esbuild.config.(json|js|ts) could be considered as a standard name, and picked up automatically. then the CLI call would be as simple as

> esbuild

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions