Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

cosmic-esbuild

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cosmic-esbuild

Simplifying esbuild configurations in a familiar way

Source
npmnpm
Version
0.1.1
Version published
Weekly downloads
199
19800%
Maintainers
1
Weekly downloads
 
Created
Source

cosmic-esbuild

Simplifying esbuild configurations in a familiar way.

License Version: npm CI: Node

Description

This package allows you declaratively configure esbuild using the popular cosmiconfig format. No more custom build scripts, no more lengthy build commands in your manifest.

Installation

npm install cosmic-esbuild

Usage

Configuration

Create a file for your configuration, see the following examples:

JSON
{
	"entryPoints": ["app.js"],
	"bundle": true,
	"sourcemap": "external",
	"outdir": "lib"
}
YAML
bundle: true
entryPoints:
  - "app.js"
outdir: "lib"
sourcemap: "external"
TOML
bundle = true
entryPoints = [ "app.js" ]
outdir = "lib"
sourcemap = "external"
TypeScript
import type { BuildOptions } from "esbuild";

const config = {
	bundle: true,
	entryPoints: ["app.js"],
	outdir: "dist",
	sourcemap: "external",
} satisfies BuildOptions;

export default config;
package.json
{
	"name": "your-package",
	"scripts": {
		"build": "cosmic-esbuild",
		"dev": "cosmic-esbuild --watch"
	},
	"esbuild": {
		"bundle": true,
		"entryPoints": ["app.js"],
		"outdir": "lib",
		"sourcemap": "external"
	}
}

Supported formats

You can write your configuration to any of the following formats (sorted by precedence):

  • package.json (add the esbuild property with your config)
  • .esbuildrc
  • .esbuildrc.json
  • .esbuildrc.jsonc
  • .esbuildrc.yaml
  • .esbuildrc.yml
  • .esbuildrc.toml
  • esbuild.config.json
  • esbuild.config.jsonc
  • esbuild.config.yaml
  • esbuild.config.yml
  • esbuild.config.toml
  • esbuild.config.js
  • esbuild.config.ts
  • esbuild.config.cjs
  • esbuild.config.mjs

CLI

# Build, auto-load config
npx cosmic-esbuild

# Build, specify config
npx cosmic-esbuild --config esbuild.config.ts

# Watch
npx cosmic-esbuild --watch

License

This work is licensed under The MIT License.

Keywords

esbuild

FAQs

Package last updated on 15 Jun 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts