A legacy minifier that combines swc for outdated script-style code and esbuild for modern ES6+ syntax, enabling gradual project modernization without breaking existing codebase. v2.6.1 (stable, released 2023-09) ships TypeScript types. Key differentiators: safety-first approach (preserves original globals, only outputs minified sidecar files) and uses a // @MODULE annotation for selective module bundling. Active maintenance with low release cadence.
npm install sitting-duckNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates basic usage of sitting-duck with glob patterns for JavaScript and CSS files, excluding already minified files and node_modules.
Ensure files using import/export statements have // @MODULE as the first line; otherwise swc minification may break syntax.
Use import syntax; rename file to .mjs or set "type": "module" in package.json.
Use NODE_ENV=development instead of --dev flag.
Use relative paths in CSS @import; test after minification.
Change to import minify from 'sitting-duck' and ensure file is ESM (.mjs or { "type": "module" })Add // @MODULE as the very first line of the file (before any code)
Verify glob pattern and file paths; use array form: ['src/*.js', '!node_modules']