Using a Plugin

    A plugin can be published on npm in CommonJS format as vuepress-plugin-xxx. You can use it:

    1. module.exports = {
    2. plugins: [ 'vuepress-plugin-xxx' ]
    3. }

    If you prefix the plugin with vuepress-plugin-, you can use a shorthand to leave out that prefix:

    1. module.exports = {

    Same with:

    1. module.exports = {
    2. plugins: [ '@org/vuepress-plugin-xxx', '@vuepress/plugin-xxx' ]
    3. }

    Shorthand:

    1. module.exports = {
    2. plugins: [ '@org/xxx', '@vuepress/xxx' ]
    3. }

    Note

    The plugin whose name starts with @vuepress/plugin- is an officially maintained plugin.

    Since this style is consistent with babel’s Plugin/Preset Options, we call it Babel Style.

    Object Style

    VuePress also provides a simpler way to use plugins from a dependency:

    1. plugins: {
    2. }
    3. }

    Note

    • Babel style
    1. module.exports = {
    2. plugins: [
    3. [ 'xxx', false ] // disabled.
    4. }
    • Object style