To install the CLI tool globally, run the following command:
npm install -g @devexteam/dvx-cli
As a development dependency To install the CLI tool as a development dependency in your personal project, run the following command:
npm install --save-dev @devexteam/dvx-cli
As an optional dependency To install the CLI tool as an optional dependency, run the following command:
npm install --save-optional @devexteam/dvx-cli
dvx --version
dvx --help
Expected output:
Devexteam CLI
Recommend usage: dvx <cmd> [args]
Commands:
dvx img:minify Minify images
dvx img:towebp Format/Convert images to webp
dvx img:resize Resize images, fixes to 1024px width
dvx img:optimize Process images (minify, convert to webp and resize).
dvx html:validate Validate html files with htmlhint.
Read about rules on:
- https://github.com/htmlhint/HTMLHint/wiki/Rules
- https://htmlhint.com/docs/user-guide/list-rules
dvx files:clean-sourcemaps Clean sourcemaps comments (like /*# sourceMappingURL=foo.css.map
*/) from your CSS files. They can cause conflict in the compiling
or packaging process.
This CLI tool integrates and encapsulates essential utilities (sharp
, imagemin
, HTMLHint
, ImageMagick
, GraphicsMagick
) to streamline the asset optimization process for images and HTML.
- Use in the root project path
- Use in a
bash
/unix
console - Install ImageMagick*
- The CLI has a fallback to sharp
- Install GraphicsMagick*
- The CLI has a fallback to sharp
📂 project-root/
├─ 📂 src/
│ ├─ 📂 assets/
│ │ ├─ 📂 img/
│ │ │ ├─ 📂 dist/
│ │ │ └─ 📂 src/
Thank you for your support! ❤️. Your feedback is highly appreciated. If you found this project useful and would like to support its development, or if you'd just like to buy me a coffee, you can do so via PayPal: