Home Reference Source Repository

Typedef

Static Public Summary
public

Output path object.

public

Roc builder object.

public

Roc server.

public

Roc server options.

public

Starts a server.

Static Public

public outputPath: Object source

Output path object.

Properties:

NameTypeAttributeDescription
absolute string
  • nullable: false

Absolute path to where the build should be saved on disk.

relative string
  • nullable: false

Relative path to where the build should be saved on disk, based on from where the command is run from.

public rocBuilder: Object source

Roc builder object.

Properties:

NameTypeAttributeDescription
buildConfig object

Webpack config object, can be used to extend the configuration.

builder object

Webpack instance.

See:

public rocServer: Object source

Roc server.

Properties:

NameTypeAttributeDescription
server object

Koa instance.

start startServer

Starts the server.

public rocServerOptions: Object source

Roc server options.

Used in createServer.

Both of these options can also be set in roc.config.js however these values will override them if provided.

Properties:

NameTypeAttributeDescription
serve string | string[]
  • optional

The folders to serve from the server. Paths will be based from where the application is started.

favicon string
  • optional

The path to the favicon. This file will be handled in the server in a special way.

public startServer(port: number): function source

Starts a server.

The port for the server to start on can be selected in 3 ways and has priority in the same order.

  1. The param for the function, port
  2. Environment variable, PORT
  3. The port from roc.config.js

Params:

NameTypeAttributeDescription
port number
  • optional
  • default: PORT/roc.config.js

the port to start the server on.