このドキュメントはminista 4(旧バージョン)に関するものです。最新バージョンについては、https://minista.devを参照してください。

  • v4.0.13(旧バージョン)
  • v3.1.12

pluginComment

HTMLにコメントを出力するプラグイン。

Table of Contents

How To Use

./vite.config.js
import { pluginSsg, pluginComment } from "minista"

export default {
  plugins: [pluginSsg(), pluginComment()],
}
./src/pages/index.jsx
import { Comment } from "minista/assets"

export default function () {
  return <Comment text="Outputting comments in react jsx" />
}

Options

※オプションはありません

Comment

HTMLにコメントを出力するコンポーネント。

./src/pages/index.jsx
import { Comment } from "minista/assets"

export default function () {
  return (
    <>
      <Comment text="+ comment" />
      <h1>index</h1>
      <Comment text="- comment" />
    </>
  )
}
Dist
<!-- + comment -->
<h1>index</h1>
<!-- - comment -->
type CommentProps = CommentUseContent | CommentUseChildren

type CommentUseContent = {
  text: string
  children?: string
}
type CommentUseChildren = {
  text?: string
  children: string
}