- Notifications
You must be signed in to change notification settings - Fork0
You probably want to use original lib -https://github.com/kangax/html-minifier
NotificationsYou must be signed in to change notification settings
Yuriy-Svetlov/html-minifier-without-js
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
You probably want to use original lib -https://github.com/kangax/html-minifier
npm i html-minifier-without-js
import{minify}from'html-minifier-without-js/src/htmlminifier.js'lethtmlSource='<div> <h1>TEST H1</h1> <h2>TEST H2</h2></div> <p title="blah"> foo </p>';varresult=minify(htmlSource,{collapseWhitespace:true,//удаляем пустые пространства между тегамиremoveComments:true,//удаляем коментарииremoveScriptTypeAttributes:true,//Remove type="text/javascript" from script tags. Other type attribute values are left intactincludeAutoGeneratedTags:false,ignoreCustomComments:[// ignore noindex comments/^noindex/,/\/noindex+$/],minifyCSS:true,//минифицирует JStrimCustomFragments:true,//Удаляет пустой пространство около игнорируемых элементов//ignoreCustomFragments: [ (/\{\%[^\%]*?\%\}(\s)?/g) ], //Игнорирования тега});console.log(result);
About
You probably want to use original lib -https://github.com/kangax/html-minifier
Resources
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Releases
No releases published
Packages0
No packages published
Uh oh!
There was an error while loading.Please reload this page.