A lightweight and flexible minifier for JavaScript, CSS, and HTML with live file-watching support.
✅ Minifies JavaScript, CSS, and HTML efficiently
✅ Supports live watching for automatic minification
✅ Configurable options for each file type
✅ Lightweight and easy to use
Powered by:
Before installing minifix, make sure your environment meets the following requirements:
- Node.js
14+
(recommended16+
) - NPM
6.14+
(recommended8+
)
Before installing minifix, consider whether you need a local or global installation:
- A local installation is recommended for project-specific usage, ensuring that each project uses the correct version of minifix.
- A global installation allows you to use minifix across multiple projects system-wide without reinstalling it.
npm install --save-dev minifix
npm install --global minifix
npx minifix
minifix
📌 If minifix.config.mjs
does not exist, it will be created automatically.
minifix supports minification for:
- JavaScript (
.js
,.mjs
,.cjs
) - HTML (
.html
,.htm
) - CSS (
.css
)
Edit the minifix.config.mjs
file to define input files, output files, and minification options.
- inputs - List of input files
- outputs (optional) - List of output files. If not provided, a default output file will be created in the same directory as the input file with
_output_
appended to its name. - minifyOptions - Minification options for each file type
📌 Refer to the official documentation for minifyOptions:
/* minifix.config.mjs */
export default {
inputs: ["views/input.html", "assets/css/input.css", "assets/js/input.js"],
outputs: ["views/index.html", "assets/css/style.css", "assets/js/default.js"],
minifyOptions: {
css: {
format: false
},
js: {
format: {
preamble: "/** Comment */"
}
},
html: {
collapseWhitespace: true,
removeComments: true,
removeRedundantAttributes: true
}
}
};
We appreciate any contributions!
If you encounter any issues, please open an issue in our GitHub repository:
➡️ GitHub Repository
➡️ Create a new issue
For feature requests or bug reports, follow these steps:
- Check the existing issues to avoid duplicates.
- If the issue is new, create one with a clear description and steps to reproduce.
- If you’d like to submit code changes, fork the repository and create a pull request.
minifix is released under the MIT License.
If you have any questions, feel free to reach out: ramoures@gmail.com