pluginBeautify
ビルド時にHTML・CSS・JSを整形するプラグイン。
Table of Contents
How To Use
import { pluginBeautify } from "minista"
export default {
plugins: [pluginBeautify()],
}Options
pluginBeautify({
src: ["**/*.{html,css,js}"],
htmlOptions: {
indent_size: 2,
max_preserve_newlines: 0,
indent_inner_html: true,
extra_liners: [],
inline: ["span", "strong", "b", "small", "del", "s", "code", "br", "wbr"],
},
cssOptions: {
indent_size: 2,
space_around_combinator: true,
},
jsOptions: {
indent_size: 2,
},
removeImagePreload: true,
})src
- 型:
string[] - デフォルト:
["**/*.{html,css,js}"]
対象ファイルをdistからのglob形式で指定します。対象ファイルはビルドパイプラインに含まれているものからpicomatchで選ばれます。
htmlOptions
- 型:
HTMLBeautifyOptions
js-beautifyのHTMLフォーマットに関する設定。
cssOptions
- 型:
HTMLBeautifyOptions
js-beautifyのCSSフォーマットに関する設定。
jsOptions
- 型:
HTMLBeautifyOptions
js-beautifyのJavaScriptフォーマットに関する設定。
removeImagePreload
- 型:
boolean - デフォルト:
true
React 19がHTMLに出力する画像用のPreloadタグを削除します。