1.0.3 • Published 6 years ago

rsys-minimize v1.0.3

Weekly downloads
6
License
MIT
Repository
github
Last release
6 years ago

rsys-minimize

CLI node app that let you minimize an HTML file, keep special comments, and keep Responsys functions intact.

Options

Usage: rsys-minimize

Install

npm install -g rsys-minimize

Note: You must install this package globally to be able to use it anywhere from the CLI.

How to use

rsys-minimize C:\work\filename.htm

The resulted minimized file will be created and saved in the same folder with .min added to the name, like filename.min.htm.

Use it from inside VSCode as a task

Configure a custom task in VSCode to minimize the current opened file.

Here is an example task file that add the tasks rsys-minimize.

{
    // See https://go.microsoft.com/fwlink/?LinkId=733558
    // for the documentation about the tasks.json format
    "version": "2.0.0",
    "tasks": [
        {
            "taskName": "rsys-minimize",
            "type": "shell",
            "command": "rsys-minimize ${file}",
            "presentation": {
                "reveal": "never"
            }
        }
    ]
}

About HTML comments

Plain comments

Plain HTML comments will get removed.

<!-- REMOVE THIS -->

Special comments

Special comments starting with double asterisk will not be removed.

<!--** KEEP THIS -->

IE Conditional comments

IE conditional comments will not be removed.

<!--[if IE 6]>KEEP THIS TOO<![endif]-->
<!--[if !IE]> -->ALSO KEEP THIS<!-- <![endif]-->

About Responsys functions inside comments

Any RSYS function found inside an HTML comment will be extracted and preserverd in the code.

From this...

<!-- This is an example of a test string
$setglobalvars(my_var, "test string")$
-->

To this...

$setglobalvars(my_var, "test string")$