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
muslnode 18–226 runs
build_error
glibcnode 18–226 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.fixAdd .melodist/ to .gitignore
affects: >=0.0.0
gotchaExternal dependencies: Only dependencies and peerDependencies are external by default; devDependencies are bundled unless explicitly externalized.fixUse --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.fixUse --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.fixSet "exports": { "import": "./.melodist/esm/index.mjs" } affects: >=0.0.0
breakingMelodist v0.10.0 changed default srcdir from lib/ to src/.fixEither 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.fixUse 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.
fixInstall 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.
fixEnsure 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.
fixAdd --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.
fixCheck package.json main vs module fields; use .mjs for ESM exports or set type: module.
Audit
Dependencies
No dependency data recorded yet.