/vuepress-plugin-serve

:key: Serve generated files in VuePress.

Primary LanguageJavaScriptMIT LicenseMIT

vuepress-plugin-serve

Migrated to vuepress-community

npm

A VuePress plugin that serves generated files.

CLI

After using this plugin, VuePress will add a serve command. This command will created a server based on the generated files. It has the following options:

--build

Execute vuepress build before creating the server.

--open

Open the browser when the server is ready.

--host <host>

See host.

--port <port>

See port.

Options

commandName

  • type: string
  • default: 'serve'

Vuepress-plugin-serve will add a vuepress command. This option can be used to specify the command name.

host

  • type: string
  • default: 'localhost'

Specify the host to use for the server.

port

  • type: number
  • default: 8080

Specify the port to use for the server.

notFoundPath

  • type: string
  • default: '404.html'

Path for "404 not found" page.

staticOptions

  • type: object
  • default: {}

Options for serve-static.

beforeServer

  • type: (app, server) => void
  • default: undefined

Executed before the server accepts client information. Similar to VuePress's beforeDevServer option.

afterServer

  • type: async (app, server) => void
  • default: undefined

Executed after the server accepts client information. Similar to VuePress's afterDevServer option.

chainWebpack

  • type: (config: Config) => void
  • default: undefined

This hook will be called when the server is being built.

See chainWebpack.

define

  • type: Record<string, string> | (() => Record<string, string>)
  • default: {}

This hook will be called when the server is being built.

See define.

alias

  • type: Record<string, string> | (() => Record<string, string>)
  • default: {}

This hook will be called when the server is being built.

See alias.

Contribution

Contribution Welcome!