Files
vuepress/packages/docs/docs/plugin
2019-06-04 14:53:36 +08:00
..
2019-06-04 14:37:38 +08:00
2019-03-05 00:42:22 +08:00
2018-12-13 00:50:38 +08:00
2019-05-01 13:13:06 +08:00
2019-06-04 14:53:36 +08:00
2018-10-26 01:34:49 +08:00

Plugin

Plugins usually add global-level functionality to VuePress. There is no strictly defined scope for a plugin - there are typically several types of plugins:

  1. Extend the page's metadata generated at compile time. e.g. @vuepress/plugin-last-updated;
  2. Generate extra files before or after compilation. e.g. @vuepress/plugin-pwa;
  3. Inject global UI. e.g. @vuepress/plugin-back-to-top;
  4. Extend the CLI with custom commands. e.g. vuepress-plugin-export.

Here is also a litte slightly complicated plugin example @vuepress/plugin-blog. that uses compile-time metadata to generate some dynamic modules and initialize them on the client side by using enhanceAppFiles.

The architecture of the whole plugin system is as follows:

Architecture of VuePress