Registry / devops / cordova-plugin-minify

cordova-plugin-minify

JSON →
library1.0.1jsnpmunverified

A Cordova plugin that automatically minifies JavaScript and CSS files for release builds using Terser and CleanCSS. Current version 1.0.1, with a stable but infrequent release cadence (last update years ago). Key differentiators: integrates into Cordova build process, supports combining JavaScripts into a single file, allows configuration via minifyconfig.json, and offers scanning of HTML files for script tag order. Compared to manual minification, it automates the optimization step without modifying source files.

npm install cordova-plugin-minify
INSTALL
IMPORT
SIG · CORDOVA-PLUGIN-MIN
C
cordova-plugin-minify
devopsjavascriptv1.0.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

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

cordova-plugin-minify
cordova plugin add cordova-plugin-minify
npm install cordova-plugin-minify --save-dev
This is a Cordova plugin, not an npm package. Install via cordova plugin add, not npm.

Shows installation and basic usage: install plugin, build with --release to trigger minification of JS/CSS files.

// Install the plugin cordova plugin add cordova-plugin-minify // Create minifyconfig.json in project root with default config (or customize) // Build release (minification enabled by default for --release) cordova build android --release // To run with debug and still minify, set minifyEnabled to 'Always' in config
Debug
Known issues
gotchaPlugin only processes files during build; it does not watch for changes. You must rebuild to see minified output.
fix
Rebuild your Cordova project after making changes to HTML/JS/CSS files.
affects: >=0.0.0
gotchaCombining JavaScripts can break dependencies if files are combined out of order. Use scanHtml strategy with proper ordering via files.paths.
fix
Set javascriptStrategy to 'scanHtml' and arrange file paths in correct dependency order under files.paths.
affects: >=0.0.0
breakingThe plugin may replace script tags in HTML incorrectly, causing broken references or missing scripts.
fix
Review generated HTML after build, especially when using combineJavascripts. Ensure scanning order matches script load order.
affects: >=1.0.0
gotchaPlugin minifies files in-place, overwriting original source files. There is no backup of unminified files.
fix
Keep a version control backup or use separate source and build directories. The plugin operates on the www directory in-place.
affects: >=0.0.0
Errors
Common errors & fixes
Error: Cannot find module 'cordova-plugin-minify'
The plugin was installed via npm instead of cordova plugin add.
fix
Run 'cordova plugin add cordova-plugin-minify' from your project root.
Minification not happening in --release build
minifyEnabled is set to 'Release' but the build command didn't include --release.
fix
Use 'cordova build android --release' or set minifyEnabled to 'Always' in minifyconfig.json.
After build, all script tags are removed except one that references all.min.js
combineJavascripts is enabled and the plugin replaced all <script> tags with a single one.
fix
Disable combineJavascripts by setting 'enabled': false, or ensure scanHtml strategy captures correct order.
Upgrade
Version history
1.0.1latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources
cordova-plugin-minify — npm install cordova-plugin-minify · libregistry