PostHtml 中的一些有用的插件

記錄一下 PostHtml 中的一些比較有用的插件
參考自PostHtml文檔css

posthtml-pug

將pug轉化成htmlhtml

posthtml-md

將md語法轉化爲html語法vue

posthtml-retext

根據規則轉化天然語言(例如特定字符串轉成emoji表情)git

posthtml-head-elements

將JSON配置生成head元素內容github

posthtml-include

引入html片斷(實現html的模塊化)less

posthtml-modules

同上,並且她能實現vue中slot的效果模塊化

posthtml-inline-assets

將外部的css、js、圖片等資源內聯進htmlpost

posthtml-cache

在某標籤的某屬性值後增長隨機查詢參數,如spa

<script src="script.js"></script>
<!-- 處理後 -->
<script src="script.js?v=93ce_Ltuub"></script>

posthtml-spaceless

刪除指定區域內標籤之間的空格插件

posthtml-postcss

使用postcss處理html內的樣式(style標籤和內聯樣式)

posthtml-px2rem

在html內使用px2rem處理style標籤和內聯樣式

posthtml-inline-css

可將外部樣式或style標籤內樣式弄成內聯樣式

posthtml-collect-inline-styles

可將內聯樣式提取到style標籤內

posthtml-style-to-file

可將內聯樣式和style標籤內樣式提取到獨立文件內

posthtml-color-shorthand-hex-to-six-digit

將縮寫的hex color轉化成6個字符的格式

posthtml-minifier

壓縮

htmlnano

同上

posthtml-remove-attributes

根據屬性名或值去除指定屬性

posthtml-remove-tags

去除指定名稱的標籤

Posthtml-remove-duplicates

根據標籤名刪除內容徹底同樣的標籤

posthtml-transfomer

1.將標記的引用外部文件的script或link標籤的內容,內聯進html
2.將標記的標籤刪除
3.將標記的多個引用外部文件的script或link標籤的內容,內聯進html內的同一標籤內

posthtml-tidy

整理html、清理無用的標籤

相關文章
相關標籤/搜索