0.0.3 • Published 4 years ago

vite-plugin-posthtml v0.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

Vite Plugin PostHTML

Vite plugin to run PostHTML. Currently only runs on served/built HTML files (index.html).

Installation

$ npm install vite-plugin-posthtml

In your vite.config.js file:

const { posthtmlPlugin } = require('vite-plugin-posthtml');

module.exports = {
  plugins: [
    posthtmlPlugin({
      /* config */
    }),
  ],
};

Config

The plugin's config is an object that takes three optional properties: plugins, options, and posthtml:

  • plugins - PostHTML plugins. You can mix synchronous and asynchronous plugins; the Vite plugin will always run in asynchronous mode.
  • options - PostHTML parser options. sync will always be overridden to false.
  • posthtml - If you'd like to override the PostHTML function that gets called (like to use a different version), you can pass it in here.