A command-line tool and library that applies JSMin minification while generating source maps. Version 0.16.0 is the latest release; the project has seen sporadic updates with no recent activity. It differentiates from plain JSMin by producing source maps for debugging minified JavaScript, useful in build pipelines. The library offers a Node.js API and CLI interface with basic minification and source map generation.
npm install jsmin-sourcemapNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to minify a JavaScript file and generate a source map using the jsminSourcemap function.
Ensure the first argument is a string (use .toString() or .utf8Slice() if needed).
Always provide the 'sourceFile' option (and optionally 'destFile') to get correct source mappings.
If you need inline maps, set the 'inlineMap' option to true in the options object.
Migrate to using the JavaScript API (jsminSourcemap function) and maintain your own CLI wrapper if needed.
Add a declaration file (e.g., declare module 'jsmin-sourcemap') or use @ts-ignore.
Ensure the first argument is a valid JavaScript string and not empty.
Pass a sourceFile property in the options object.
Ensure destFile is a string (filename) or omit it.