Registry / devops / melodist

melodist

JSON →
library0.1.6jsnpmunverified

Melodist is an opinionated bundler for creating TypeScript libraries, version 0.11.1. It uses ESBuild and TypeScript to generate multiple output formats (CJS, ESM, IIFE, React Native) for maximum compatibility. It works in tandem with ESBuild and TypeScript, offering automatic externalization of dependencies, global variable definitions for browser usage, and support for CSS entry points. Release cadence is stable but not documented as frequent.

npm install melodist
INSTALL
IMPORT
SIG · MELODIST
M
melodist
devopsjavascriptv0.1.6
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

melodist
npx melodist [options]
import melodist from 'melodist'
Melodist is a CLI tool, not a library. Use npx or npm scripts to run it.
default (CLI)
npx melodist --help
npx melodist --format esm --minify
Common mistake: not distinguishing between flag style. Use --format not --format=esm? Actually --format=esm is correct. More common mistake: forgetting --external flags.
config file
melodist.config.ts
melodist.config.js
If using TypeScript, the config file should be .ts. Melodist reads melodist.config.ts or melodist.config.js.

Installation, package.json configuration, and basic build command for a TypeScript library.

// First install melodist // npm install -D melodist // In package.json, add scripts: { "scripts": { "build": "melodist --format esm,cjs", "prepublishOnly": "melodist" }, "main": "./.melodist/cjs/index.js", "module": "./.melodist/esm/index.js", "types": "./.melodist/types/index.d.ts", "exports": { "import": "./.melodist/esm/index.mjs", "require": "./.melodist/cjs/index.js" } } // Create src/index.ts with your library code // Run npm run build to generate bundles in .melodist/
melodist --version
Debug
Known issues
gotchaMelodist outputs to .melodist/ directory by default; ensure .gitignore includes this.
fix
Add .melodist/ to .gitignore
affects: >=0.0.0
gotchaExternal dependencies: Only dependencies and peerDependencies are external by default; devDependencies are bundled unless explicitly externalized.
fix
Use --external flags for any devDependencies you want to exclude.
affects: >=0.0.0
deprecatedThe --cjs, --esm, --iife, --rn flags are deprecated in favor of --format.
fix
Use --format=cjs,esm,iife,rn instead.
affects: >=0.8.0
gotchaIf using .mjs output for ESM, ensure your package.json exports field uses .mjs extension.
fix
Set "exports": { "import": "./.melodist/esm/index.mjs" }
affects: >=0.0.0
breakingMelodist v0.10.0 changed default srcdir from lib/ to src/.
fix
Either move files to src/ or use --srcdir lib/ flag.
affects: >=0.10.0 <0.11.0? Actually 0.10.0 broke it.
gotchaCSS support is experimental; CSS output may not be minified or optimized.
fix
Use a separate CSS build tool if needed.
affects: >=0.0.0
Errors
Common errors & fixes
Error: Cannot find module 'melodist'
Melodist not installed or not in PATH.
fix
Install as devDependency: npm install -D melodist, then use npx melodist or npm scripts.
Error: No entry point found. Expected src/index.ts or index.ts.
Default entry point not found.
fix
Ensure src/index.ts exists or specify entry with --entry flag or meld.config.js.
Module not found: Error: Can't resolve 'lodash'
Dependency not externalized correctly.
fix
Add --external lodash or ensure lodash is in dependencies in package.json.
Cannot use import statement outside a module
Output file uses ESM imports but runtime expects CommonJS.
fix
Check package.json main vs module fields; use .mjs for ESM exports or set type: module.
Upgrade
Version history
0.1.6latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
2 hits · last 30 days
node
2
Resources