@jsonkao/snowpack-plugin-posthtml

0.3.4 • Public • Published

@jsonkao/snowpack-plugin-posthtml

This plugin adds PostHTML support to any Snowpack project. The plugin loads your PostHTML configuration and reloads dependent HTML files when the configuration changes.

Usage

npm i -D @jsonkao/snowpack-plugin-posthtml

Then add the plugin to your Snowpack config:

// snowpack.config.js

module.exports = {
  plugins: [
    [
      '@jsonkao/snowpack-plugin-posthtml',
      {
        /* see options below */
      },
    ],
  ],
};

Plugin Options

PostHTML configuration works out of the box. The following plugin options help when you want the changing of that configuration to reload your HTML and refresh the dev page.

Name Type Description
root string, string[] Specify the local directories in which the HTML should be reloaded on configuration change
configOptions.* object Pass posthtml-load-config options directly to the loader (see configOptions).

configOptions

These options are passed directtly into the main posthtml-load-config function. They may be helpful, for instance, if your PostHTML configuration is not in your application's root directory.

Name Type Description
ctx object The context evaluated while loading your config
path string Path in which I should look for your config
options object Options passed directly to cosmiconfig

Package Sidebar

Install

npm i @jsonkao/snowpack-plugin-posthtml

Weekly Downloads

1

Version

0.3.4

License

MIT

Unpacked Size

3.69 kB

Total Files

3

Last publish

Collaborators

  • jsonkao