0.3.4 • Published 4 years ago

@jsonkao/snowpack-plugin-posthtml v0.3.4

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

@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.

NameTypeDescription
rootstring, string[]Specify the local directories in which the HTML should be reloaded on configuration change
configOptions.*objectPass 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.

NameTypeDescription
ctxobjectThe context evaluated while loading your config
pathstringPath in which I should look for your config
optionsobjectOptions passed directly to cosmiconfig
0.3.4

4 years ago

0.3.3

4 years ago

0.3.2

4 years ago

0.3.1

4 years ago

0.3.0

4 years ago

0.2.1

4 years ago

0.2.0

4 years ago

0.1.0

4 years ago