{"id":25551,"library":"esw","title":"esw","description":"esw is a zero-configuration JavaScript/TypeScript library build tool that leverages esbuild for blazing fast performance. Version 0.15.0 is the current stable release, with a moderate release cadence. It infers build options from package.json fields (main, module, type) and automatically excludes dependencies and peerDependencies from the bundle. Unlike tsdx or tsup, esw focuses on minimal configuration and esbuild CLI compatibility. Supports Node.js >=14.14.0 and outputs both CommonJS and ESM formats.","status":"active","version":"0.15.0","language":"javascript","source_language":"en","source_url":"ssh://git@github.com/lbwa/esw","tags":["javascript","esbuild","typescript","library","build-tool"],"install":[{"cmd":"npm install esw","lang":"bash","label":"npm"},{"cmd":"yarn add esw","lang":"bash","label":"yarn"},{"cmd":"pnpm add esw","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"esw is a CLI tool; programmatic API is not exposed. The import shown is a placeholder; actual usage is via CLI commands like `npx esw build`.","wrong":"const esw = require('esw')","symbol":"esw","correct":"import esw from 'esw'"}],"quickstart":{"code":"mkdir my-lib && cd my-lib\nnpm init -y\nnpm i esw -D\n# Edit package.json to add main/module fields\necho '{\"name\":\"my-lib\",\"main\":\"dist/index.cjs.js\",\"module\":\"dist/index.esm.js\",\"scripts\":{\"build\":\"esw build\"}}' > package.json\nmkdir src\necho 'export const add = (a,b) => a+b' > src/index.ts\nnpm run build\nls dist","lang":"typescript","description":"Create a TypeScript library, configure package.json, and run esw build to output both CJS and ESM bundles in dist/ folder."},"warnings":[{"fix":"Ensure package.json has 'main' and/or 'module' fields pointing to desired output paths.","message":"esw relies on package.json fields. If main/module are not declared, build may produce no output or fail silently.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Use 'main' for CommonJS output, 'module' for ESM output.","message":"The output format for the 'module' field is always treated as ESM; do not expect CJS for that field.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Refer to esbuild documentation for option compatibility.","message":"esw uses esbuild internally; some esbuild options may not be fully supported or behave differently.","severity":"gotcha","affected_versions":">=0.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Create src/index.ts or specify entry point explicitly: esw build src/main.ts","cause":"No source files found at default location (src/index.ts) or specified path is incorrect.","error":"Error: Could not resolve entry point"},{"fix":"Run 'npm install esw --save-dev' and use 'npx esw' or add to scripts in package.json.","cause":"esw is not installed or not in PATH.","error":"esw: command not found"},{"fix":"Ensure package.json exists and contains a 'main' field.","cause":"package.json is missing or does not have 'main' field when esw tries to infer output.","error":"TypeError: Cannot read properties of undefined (reading 'main')"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}