forthebadge forthebadge forthebadge forthebadge forthebadge forthebadge

Grunt JSON Javascript Git Gitub NPM

~ Demo ~

📌 Description

Minification is the process of removing unnecessary elements and rewriting code to reduce file size. These are usually webpage resources, such as HTML, CSS, and JavaScript files or even Images. Reducing the size of web resources allows files to be transferred faster, which makes web pages load faster.

Minificator allows you to minify and compress multiple files automatically, this package is based on task runner grunt, currently minificator supports the following files:

  • Any Image file with extension .png .jpg .svg .gif
  • Any HTML file
  • Any CSS file
  • Any Javascript file

Here are the benefits of using Minificator:

  • You can use it on any project
  • Easy to use, all tasks are preconfigured, just type easy to remember commands to start minituarization
  • You no longer need to use a web application or other similar software
  • Minificator is isolated in a working folder of its own, which means if you use another gruntfile, it’s not a problem

📌 Install & Update

You can install Minificator with NPM:

npm i @raja_rakoto/minificator

If you already have Minificator in your project and just want to update it, run the following command:

npm update @raja_rakoto/minificator && rm -r minificator && grunt --gruntfile node_modules/@raja_rakoto/minificator/minificator.js minificator-init

WARNING: All files contained in the “minificator” directory will be deleted after the update, so remember to make a backup before starting an update

📌 Init

After installation, you need to initialize Minificator in your project root directory to use it, run the command below:

grunt --gruntfile node_modules/@raja_rakoto/minificator/minificator.js minificator-init

NOTE: You cannot initialize if the “minificator” directory is already present in your project, please delete it before starting the initialization

📌 Use

After initialization, you need to go to the newly generated minificator folder and type grunt in your console to see all executable commands

Just copy the files to be minified in the directory input/images for images or input/scripts for javascript file and so on …

Then run the minification command, for example:

grunt minificator-js

Finally, the minifier files are in output directory



View Github